var isIE=navigator.userAgent.toLowerCase().indexOf("msie")>-1;var isMoz=document.implementation&&document.implementation.createDocument;var isSafari=((navigator.userAgent.toLowerCase().indexOf("safari")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("mac")!=-1))?true:false;function curvyCorners(){if(typeof (arguments[0])!="object"){throw newCurvyError("First parameter of curvyCorners() must be an object.")}if(typeof (arguments[1])!="object"&&typeof (arguments[1])!="string"){throw newCurvyError("Second parameter of curvyCorners() must be an object or a class name.")}if(typeof (arguments[1])=="string"){var G=0;var A=getElementsByClass(arguments[1])}else{var G=1;var A=arguments}var D=new Array();if(arguments[0].validTags){var F=arguments[0].validTags}else{var F=["div"]}for(var C=G,B=A.length;C0){this.box.innerHTML=""}this.applyCorners=function(){for(var Z=0;Z<2;Z++){switch(Z){case 0:if(this.settings.tl||this.settings.tr){var W=document.createElement("DIV");W.style.width="100%";W.style.fontSize="1px";W.style.overflow="hidden";W.style.position="absolute";W.style.paddingLeft=this.borderWidth+"px";W.style.paddingRight=this.borderWidth+"px";var R=Math.max(this.settings.tl?this.settings.tl.radius:0,this.settings.tr?this.settings.tr.radius:0);W.style.height=R+"px";W.style.top=0-R+"px";W.style.left=0-this.borderWidth+"px";this.topContainer=this.box.appendChild(W)}break;case 1:if(this.settings.bl||this.settings.br){var W=document.createElement("DIV");W.style.width="100%";W.style.fontSize="1px";W.style.overflow="hidden";W.style.position="absolute";W.style.paddingLeft=this.borderWidth+"px";W.style.paddingRight=this.borderWidth+"px";var X=Math.max(this.settings.bl?this.settings.bl.radius:0,this.settings.br?this.settings.br.radius:0);W.style.height=X+"px";W.style.bottom=0-X+"px";W.style.left=0-this.borderWidth+"px";this.bottomContainer=this.box.appendChild(W)}break}}if(this.topContainer){this.box.style.borderTopWidth="0px"}if(this.bottomContainer){this.box.style.borderBottomWidth="0px"}var d=["tr","tl","br","bl"];for(var h in d){if(h>-1<4){var c=d[h];if(!this.settings[c]){if(((c=="tr"||c=="tl")&&this.topContainer!=null)||((c=="br"||c=="bl")&&this.bottomContainer!=null)){var V=document.createElement("DIV");V.style.position="relative";V.style.fontSize="1px";V.style.overflow="hidden";if(this.backgroundImage==""){V.style.backgroundColor=this.boxColour}else{V.style.backgroundImage=this.backgroundImage}switch(c){case"tl":V.style.height=R-this.borderWidth+"px";V.style.marginRight=this.settings.tr.radius-(this.borderWidth*2)+"px";V.style.borderLeft=this.borderString;V.style.borderTop=this.borderString;V.style.left=-this.borderWidth+"px";break;case"tr":V.style.height=R-this.borderWidth+"px";V.style.marginLeft=this.settings.tl.radius-(this.borderWidth*2)+"px";V.style.borderRight=this.borderString;V.style.borderTop=this.borderString;V.style.backgroundPosition="-"+(R+this.borderWidth)+"px 0px";V.style.left=this.borderWidth+"px";break;case"bl":V.style.height=X-this.borderWidth+"px";V.style.marginRight=this.settings.br.radius-(this.borderWidth*2)+"px";V.style.borderLeft=this.borderString;V.style.borderBottom=this.borderString;V.style.left=-this.borderWidth+"px";V.style.backgroundPosition="-"+(this.borderWidth)+"px -"+(this.boxHeight+(X+this.borderWidth))+"px";break;case"br":V.style.height=X-this.borderWidth+"px";V.style.marginLeft=this.settings.bl.radius-(this.borderWidth*2)+"px";V.style.borderRight=this.borderString;V.style.borderBottom=this.borderString;V.style.left=this.borderWidth+"px";V.style.backgroundPosition="-"+(X+this.borderWidth)+"px -"+(this.boxHeight+(X+this.borderWidth))+"px";break}}}else{if(this.masterCorners[this.settings[c].radius]){var V=this.masterCorners[this.settings[c].radius].cloneNode(true)}else{var V=document.createElement("DIV");V.style.height=this.settings[c].radius+"px";V.style.width=this.settings[c].radius+"px";V.style.position="absolute";V.style.fontSize="1px";V.style.overflow="hidden";var M=parseInt(this.settings[c].radius-this.borderWidth);for(var T=0,g=this.settings[c].radius;T=M){var O=-1}else{var O=(Math.floor(Math.sqrt(Math.pow(M,2)-Math.pow((T+1),2)))-1)}if(M!=g){if((T)>=M){var L=-1}else{var L=Math.ceil(Math.sqrt(Math.pow(M,2)-Math.pow(T,2)))}if((T+1)>=g){var J=-1}else{var J=(Math.floor(Math.sqrt(Math.pow(g,2)-Math.pow((T+1),2)))-1)}}if((T)>=g){var I=-1}else{var I=Math.ceil(Math.sqrt(Math.pow(g,2)-Math.pow(T,2)))}if(O>-1){this.drawPixel(T,0,this.boxColour,100,(O+1),V,-1,this.settings[c].radius)}if(M!=g){for(var S=(O+1);S=L){if(L==-1){L=0}this.drawPixel(T,L,this.borderColour,100,(J-L+1),V,0,0)}}else{if(J>=O){this.drawPixel(T,(O+1),this.borderColour,100,(J-O),V,0,0)}}var Q=this.borderColour}else{var Q=this.boxColour;var J=O}if(this.settings.antiAlias){for(var S=(J+1);S0)?0:-1),this.settings[c].radius)}}}this.masterCorners[this.settings[c].radius]=V.cloneNode(true)}if(c!="br"){for(var Z=0,f=V.childNodes.length;Z0){var a=document.createElement("DIV");a.style.position="relative";a.innerHTML=this.boxContent;a.className="autoPadDiv";var n=Math.abs(R-this.boxPadding);var p=Math.abs(X-this.boxPadding);if(R1||G<0){G=1}var H=Math.round((D*G)+(C*(1-G)));if(H>255){H=255}if(H<0){H=0}var B=Math.round((K*G)+(I*(1-G)));if(B>255){B=255}if(B<0){B=0}var A=Math.round((F*G)+(E*(1-G)));if(A>255){A=255}if(A<0){A=0}return"#"+IntToHex(H)+IntToHex(B)+IntToHex(A)}function IntToHex(A){base=A/16;rem=A%16;base=base-(rem/16);baseS=MakeHex(base);remS=MakeHex(rem);return baseS+""+remS}function MakeHex(A){if((A>=0)&&(A<=9)){return A}else{switch(A){case 10:return"A";case 11:return"B";case 12:return"C";case 13:return"D";case 14:return"E";case 15:return"F"}}}function pixelFraction(H,G,A){var C=0;var B=new Array(1);var F=new Array(1);var I=0;var D="";var E=Math.sqrt((Math.pow(A,2)-Math.pow(H,2)));if((E>=G)&&(E<(G+1))){D="Left";B[I]=0;F[I]=E-G;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(G+1,2)));if((E>=H)&&(E<(H+1))){D=D+"Top";B[I]=E-H;F[I]=1;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(H+1,2)));if((E>=G)&&(E<(G+1))){D=D+"Right";B[I]=1;F[I]=E-G;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(G,2)));if((E>=H)&&(E<(H+1))){D=D+"Bottom";B[I]=E-H;F[I]=0}switch(D){case"LeftRight":C=Math.min(F[0],F[1])+((Math.max(F[0],F[1])-Math.min(F[0],F[1]))/2);break;case"TopRight":C=1-(((1-B[0])*(1-F[1]))/2);break;case"TopBottom":C=Math.min(B[0],B[1])+((Math.max(B[0],B[1])-Math.min(B[0],B[1]))/2);break;case"LeftBottom":C=(F[0]*B[1])/2;break;default:C=1}return C}function rgb2Hex(B){try{var C=rgb2Array(B);var G=parseInt(C[0]);var E=parseInt(C[1]);var A=parseInt(C[2]);var D="#"+IntToHex(G)+IntToHex(E)+IntToHex(A)}catch(F){alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex")}return D}function rgb2Array(A){var C=A.substring(4,A.indexOf(")"));var B=C.split(", ");return B}function setOpacity(F,C){C=(C==100)?99.999:C;if(isSafari&&F.tagName!="IFRAME"){var B=rgb2Array(F.style.backgroundColor);var E=parseInt(B[0]);var D=parseInt(B[1]);var A=parseInt(B[2]);F.style.backgroundColor="rgba("+E+", "+D+", "+A+", "+C/100+")"}else{if(typeof (F.style.opacity)!="undefined"){F.style.opacity=C/100}else{if(typeof (F.style.MozOpacity)!="undefined"){F.style.MozOpacity=C/100}else{if(typeof (F.style.filter)!="undefined"){F.style.filter="alpha(opacity:"+C+")"}else{if(typeof (F.style.KHTMLOpacity)!="undefined"){F.style.KHTMLOpacity=C/100}}}}}}function inArray(C,B){for(var A=0;Acurrent+1){case true:moveTo(current+(target-current)/3);window.setTimeout(step,50);timer=1;break;default:timer=0;break}}function glideTo(A,B){target=A;mem_target=A;if(timer==0){window.setTimeout(step,50);timer=1}caption_id=B;caption=img_div.getElementsByTagName("img")[array_images[caption_id]].getAttribute("alt");if(caption==""){caption=" "}caption_div.innerHTML=caption;if(dragging==false){new_slider_pos=(scrollbar_width*(-(A*100/((max-1)*xstep)))/100)-new_posx;if(!isNaN(new_slider_pos)){slider_div.style.marginLeft=(new_slider_pos-conf_slider_width)+"px"}}}function moveTo(L){current=L;var J=max;var A=img_div.getElementsByTagName("img");for(var F=0;Fmem_target){D.style.visibility="hidden";D.style.display="none"}else{var H=Math.sqrt(10000+L*L)+100;var B=L/H*size+size;D.style.display="block";var C=(D.h/D.w*D.pc)/H*size;switch(C>max_height){case false:var G=D.pc/H*size;break;default:C=max_height;var G=D.w*C/D.h;break}var E=(images_width*0.34-C)+images_top+((C/(conf_reflection_p+1))*conf_reflection_p);D.style.left=B-(D.pc/2)/H*size+images_left+"px";if(G&&C){D.style.height=C+"px";D.style.width=G+"px";D.style.top=E+"px"}D.style.visibility="visible";switch(L<0){case true:J++;break;default:J=J-1;break}switch(D.i==caption_id){case false:D.onclick=function(){glideTo(this.x_pos,this.i)};D.className="imageFlowImg";break;default:J=J+1;var I=function(M){myLytebox.start(Event.element(M?M:window.event).link,true)};D.onclick=I;D.className="imageFlowImgNonTransparent";$("imageFlowLink").style.left=D.style.left;$("imageFlowLink").style.top=D.style.top;if(D.style.width!=""){$("imageFlowLink").style.width=(parseInt(D.style.width)+7)+"px"}if(D.style.height!=""){$("imageFlowLink").style.height=(parseInt(D.style.height)+7)+"px"}$("imageFlowLink").style.display="";$("imageFlowLink").link=D.link;$("imageFlowLink").onclick=I;break}D.style.zIndex=J}L+=xstep}}function moveImageFlowNextRight(){if((caption_id+1)=0){glideTo($("imageFlow["+(caption_id-1)+"]").x_pos,caption_id-1)}}function refresh(F){imageflow_div=document.getElementById(conf_imageflow);img_div=document.getElementById(conf_images);scrollbar_div=document.getElementById(conf_scrollbar);slider_div=document.getElementById(conf_slider);caption_div=document.getElementById(conf_captions);if(!imageflow_div.initialized){return }caption_id=0;new_caption_id=0;current=0;target=0;mem_target=0;timer=0;array_images=new Array();new_slider_pos=0;dragging=false;dragobject=null;dragx=0;posx=0;new_posx=0;xstep=150;images_width=img_div.offsetWidth;var A=999;if(navigator.appVersion.indexOf("MSIE")!=-1){A=parseFloat(navigator.appVersion.split("MSIE")[1])}images_top=imageflow_div.offsetTop+(A<7)?186:75;images_left=imageflow_div.offsetLeft;max_conf_focus=conf_focus*xstep;size=images_width*0.5;scrollbar_width=410;conf_slider_width=conf_slider_width*0.5;max_height=images_width*0.51;imageflow_div.style.height=max_height+"px";img_div.style.height=(images_width*0.338+15+80)+"px";caption_div.style.width=images_width+"px";caption_div.style.marginTop=images_width*0.03+"px";scrollbar_div.style.marginTop=images_width*0.02+"px";scrollbar_div.style.marginLeft="20px";scrollbar_div.style.width=scrollbar_width+"px";slider_div.onmousedown=function(){dragstart(this)};slider_div.style.cursor=conf_slider_cursor;max=img_div.getElementsByTagName("img").length;var D=0;var B=img_div.getElementsByTagName("img");for(var C=0;C(E.h/(conf_reflection_p+1))){case true:E.pc=118;break;default:E.pc=100;break}E.url=E.getAttribute("longdesc");E.style.cursor=conf_images_cursor;D++}}max=array_images.length;moveTo(current);glideTo(current,caption_id);if(max>2){glideTo($("imageFlow["+(Math.round(max/2)-1)+"]").x_pos,Math.round(max/2)-1)}}function show(B){var A=document.getElementById(B);A.style.visibility="visible"}function hide(B){var A=document.getElementById(B);A.style.visibility="hidden";A.style.display="none"}window.onload=function(){if(document.getElementById(conf_imageflow)){hide(conf_loading);refresh(true);show(conf_images);show(conf_scrollbar);initMouseWheel();initMouseDrag()}};window.onresize=function(){if(document.getElementById(conf_imageflow)){refresh()}};window.onunload=function(){/*document=null*/};function handle(B){imageflow_div=document.getElementById(conf_imageflow);if(imageflow_div==undefined||!imageflow_div.initialized){return }var A=false;switch(B>0){case true:if(caption_id>=1){target=target+xstep;new_caption_id=caption_id-1;A=true}break;default:if(caption_id<(max-1)){target=target-xstep;new_caption_id=caption_id+1;A=true}break}if(A==true){glideTo(target,new_caption_id)}}function wheel(A){var B=0;if(!A){A=window.event}if(A.wheelDelta){B=A.wheelDelta/120}else{if(A.detail){B=-A.detail/3}}if(B){handle(B)}if(A.preventDefault){A.preventDefault()}A.returnValue=false}function initMouseWheel(){if(window.addEventListener){imageflow_div.addEventListener("DOMMouseScroll",wheel,false)}imageflow_div.onmousewheel=wheel}function dragstart(A){dragobject=A;dragx=posx-dragobject.offsetLeft+new_slider_pos}function dragstop(){dragobject=null;dragging=false}function drag(F){posx=document.all?window.event.clientX:F.pageX;if(dragobject!=null){dragging=true;if(!isNaN(dragx)){new_posx=(posx-dragx)+conf_slider_width;if(new_posx<(-new_slider_pos)){new_posx=-new_slider_pos}if(new_posx>(scrollbar_width-new_slider_pos)){new_posx=scrollbar_width-new_slider_pos}var B=(new_posx+new_slider_pos);var E=B/((scrollbar_width)/(max-1));var D=Math.round(E);var A=(D)*-xstep;var C=D;dragobject.style.left=new_posx+"px";glideTo(A,C)}}}function initMouseDrag(){document.onmousemove=drag;document.onmouseup=dragstop;document.onselectstart=function(){if(dragging==true){return false}else{return true}}}function getKeyCode(A){A=A||window.event;return A.keyCode}document.onkeydown=function(B){var A=getKeyCode(B);switch(A){case 39:handle(-1);break;case 37:handle(1);break}}; /*! * jQuery Cycle2; version: 2.1.5 build: 20140415 * http://jquery.malsup.com/cycle2/ * Copyright (c) 2014 M. Alsup; Dual licensed: MIT/GPL */ !function(a){"use strict";function b(a){return(a||"").toLowerCase()}var c="2.1.5";a.fn.cycle=function(c){var d;return 0!==this.length||a.isReady?this.each(function(){var d,e,f,g,h=a(this),i=a.fn.cycle.log;if(!h.data("cycle.opts")){(h.data("cycle-log")===!1||c&&c.log===!1||e&&e.log===!1)&&(i=a.noop),i("--c2 init--"),d=h.data();for(var j in d)d.hasOwnProperty(j)&&/^cycle[A-Z]+/.test(j)&&(g=d[j],f=j.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,b),i(f+":",g,"("+typeof g+")"),d[f]=g);e=a.extend({},a.fn.cycle.defaults,d,c||{}),e.timeoutId=0,e.paused=e.paused||!1,e.container=h,e._maxZ=e.maxZ,e.API=a.extend({_container:h},a.fn.cycle.API),e.API.log=i,e.API.trigger=function(a,b){return e.container.trigger(a,b),e.API},h.data("cycle.opts",e),h.data("cycle.API",e.API),e.API.trigger("cycle-bootstrap",[e,e.API]),e.API.addInitialSlides(),e.API.preInitSlideshow(),e.slides.length&&e.API.initSlideshow()}}):(d={s:this.selector,c:this.context},a.fn.cycle.log("requeuing slideshow (dom not ready)"),a(function(){a(d.s,d.c).cycle(c)}),this)},a.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var b=this.opts(),c=b.slides;b.slideCount=0,b.slides=a(),c=c.jquery?c:b.container.find(c),b.random&&c.sort(function(){return Math.random()-.5}),b.API.add(c)},preInitSlideshow:function(){var b=this.opts();b.API.trigger("cycle-pre-initialize",[b]);var c=a.fn.cycle.transitions[b.fx];c&&a.isFunction(c.preInit)&&c.preInit(b),b._preInitialized=!0},postInitSlideshow:function(){var b=this.opts();b.API.trigger("cycle-post-initialize",[b]);var c=a.fn.cycle.transitions[b.fx];c&&a.isFunction(c.postInit)&&c.postInit(b)},initSlideshow:function(){var b,c=this.opts(),d=c.container;c.API.calcFirstSlide(),"static"==c.container.css("position")&&c.container.css("position","relative"),a(c.slides[c.currSlide]).css({opacity:1,display:"block",visibility:"visible"}),c.API.stackSlides(c.slides[c.currSlide],c.slides[c.nextSlide],!c.reverse),c.pauseOnHover&&(c.pauseOnHover!==!0&&(d=a(c.pauseOnHover)),d.hover(function(){c.API.pause(!0)},function(){c.API.resume(!0)})),c.timeout&&(b=c.API.getSlideOpts(c.currSlide),c.API.queueTransition(b,b.timeout+c.delay)),c._initialized=!0,c.API.updateView(!0),c.API.trigger("cycle-initialized",[c]),c.API.postInitSlideshow()},pause:function(b){var c=this.opts(),d=c.API.getSlideOpts(),e=c.hoverPaused||c.paused;b?c.hoverPaused=!0:c.paused=!0,e||(c.container.addClass("cycle-paused"),c.API.trigger("cycle-paused",[c]).log("cycle-paused"),d.timeout&&(clearTimeout(c.timeoutId),c.timeoutId=0,c._remainingTimeout-=a.now()-c._lastQueue,(c._remainingTimeout<0||isNaN(c._remainingTimeout))&&(c._remainingTimeout=void 0)))},resume:function(a){var b=this.opts(),c=!b.hoverPaused&&!b.paused;a?b.hoverPaused=!1:b.paused=!1,c||(b.container.removeClass("cycle-paused"),0===b.slides.filter(":animated").length&&b.API.queueTransition(b.API.getSlideOpts(),b._remainingTimeout),b.API.trigger("cycle-resumed",[b,b._remainingTimeout]).log("cycle-resumed"))},add:function(b,c){var d,e=this.opts(),f=e.slideCount,g=!1;"string"==a.type(b)&&(b=a.trim(b)),a(b).each(function(){var b,d=a(this);c?e.container.prepend(d):e.container.append(d),e.slideCount++,b=e.API.buildSlideOpts(d),e.slides=c?a(d).add(e.slides):e.slides.add(d),e.API.initSlide(b,d,--e._maxZ),d.data("cycle.opts",b),e.API.trigger("cycle-slide-added",[e,b,d])}),e.API.updateView(!0),g=e._preInitialized&&2>f&&e.slideCount>=1,g&&(e._initialized?e.timeout&&(d=e.slides.length,e.nextSlide=e.reverse?d-1:1,e.timeoutId||e.API.queueTransition(e)):e.API.initSlideshow())},calcFirstSlide:function(){var a,b=this.opts();a=parseInt(b.startingSlide||0,10),(a>=b.slides.length||0>a)&&(a=0),b.currSlide=a,b.reverse?(b.nextSlide=a-1,b.nextSlide<0&&(b.nextSlide=b.slides.length-1)):(b.nextSlide=a+1,b.nextSlide==b.slides.length&&(b.nextSlide=0))},calcNextSlide:function(){var a,b=this.opts();b.reverse?(a=b.nextSlide-1<0,b.nextSlide=a?b.slideCount-1:b.nextSlide-1,b.currSlide=a?0:b.nextSlide+1):(a=b.nextSlide+1==b.slides.length,b.nextSlide=a?0:b.nextSlide+1,b.currSlide=a?b.slides.length-1:b.nextSlide-1)},calcTx:function(b,c){var d,e=b;return e._tempFx?d=a.fn.cycle.transitions[e._tempFx]:c&&e.manualFx&&(d=a.fn.cycle.transitions[e.manualFx]),d||(d=a.fn.cycle.transitions[e.fx]),e._tempFx=null,this.opts()._tempFx=null,d||(d=a.fn.cycle.transitions.fade,e.API.log('Transition "'+e.fx+'" not found. Using fade.')),d},prepareTx:function(a,b){var c,d,e,f,g,h=this.opts();return h.slideCount<2?void(h.timeoutId=0):(!a||h.busy&&!h.manualTrump||(h.API.stopTransition(),h.busy=!1,clearTimeout(h.timeoutId),h.timeoutId=0),void(h.busy||(0!==h.timeoutId||a)&&(d=h.slides[h.currSlide],e=h.slides[h.nextSlide],f=h.API.getSlideOpts(h.nextSlide),g=h.API.calcTx(f,a),h._tx=g,a&&void 0!==f.manualSpeed&&(f.speed=f.manualSpeed),h.nextSlide!=h.currSlide&&(a||!h.paused&&!h.hoverPaused&&h.timeout)?(h.API.trigger("cycle-before",[f,d,e,b]),g.before&&g.before(f,d,e,b),c=function(){h.busy=!1,h.container.data("cycle.opts")&&(g.after&&g.after(f,d,e,b),h.API.trigger("cycle-after",[f,d,e,b]),h.API.queueTransition(f),h.API.updateView(!0))},h.busy=!0,g.transition?g.transition(f,d,e,b,c):h.API.doTransition(f,d,e,b,c),h.API.calcNextSlide(),h.API.updateView()):h.API.queueTransition(f))))},doTransition:function(b,c,d,e,f){var g=b,h=a(c),i=a(d),j=function(){i.animate(g.animIn||{opacity:1},g.speed,g.easeIn||g.easing,f)};i.css(g.cssBefore||{}),h.animate(g.animOut||{},g.speed,g.easeOut||g.easing,function(){h.css(g.cssAfter||{}),g.sync||j()}),g.sync&&j()},queueTransition:function(b,c){var d=this.opts(),e=void 0!==c?c:b.timeout;return 0===d.nextSlide&&0===--d.loop?(d.API.log("terminating; loop=0"),d.timeout=0,e?setTimeout(function(){d.API.trigger("cycle-finished",[d])},e):d.API.trigger("cycle-finished",[d]),void(d.nextSlide=d.currSlide)):void 0!==d.continueAuto&&(d.continueAuto===!1||a.isFunction(d.continueAuto)&&d.continueAuto()===!1)?(d.API.log("terminating automatic transitions"),d.timeout=0,void(d.timeoutId&&clearTimeout(d.timeoutId))):void(e&&(d._lastQueue=a.now(),void 0===c&&(d._remainingTimeout=b.timeout),d.paused||d.hoverPaused||(d.timeoutId=setTimeout(function(){d.API.prepareTx(!1,!d.reverse)},e))))},stopTransition:function(){var a=this.opts();a.slides.filter(":animated").length&&(a.slides.stop(!1,!0),a.API.trigger("cycle-transition-stopped",[a])),a._tx&&a._tx.stopTransition&&a._tx.stopTransition(a)},advanceSlide:function(a){var b=this.opts();return clearTimeout(b.timeoutId),b.timeoutId=0,b.nextSlide=b.currSlide+a,b.nextSlide<0?b.nextSlide=b.slides.length-1:b.nextSlide>=b.slides.length&&(b.nextSlide=0),b.API.prepareTx(!0,a>=0),!1},buildSlideOpts:function(c){var d,e,f=this.opts(),g=c.data()||{};for(var h in g)g.hasOwnProperty(h)&&/^cycle[A-Z]+/.test(h)&&(d=g[h],e=h.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,b),f.API.log("["+(f.slideCount-1)+"]",e+":",d,"("+typeof d+")"),g[e]=d);g=a.extend({},a.fn.cycle.defaults,f,g),g.slideNum=f.slideCount;try{delete g.API,delete g.slideCount,delete g.currSlide,delete g.nextSlide,delete g.slides}catch(i){}return g},getSlideOpts:function(b){var c=this.opts();void 0===b&&(b=c.currSlide);var d=c.slides[b],e=a(d).data("cycle.opts");return a.extend({},c,e)},initSlide:function(b,c,d){var e=this.opts();c.css(b.slideCss||{}),d>0&&c.css("zIndex",d),isNaN(b.speed)&&(b.speed=a.fx.speeds[b.speed]||a.fx.speeds._default),b.sync||(b.speed=b.speed/2),c.addClass(e.slideClass)},updateView:function(a,b){var c=this.opts();if(c._initialized){var d=c.API.getSlideOpts(),e=c.slides[c.currSlide];!a&&b!==!0&&(c.API.trigger("cycle-update-view-before",[c,d,e]),c.updateView<0)||(c.slideActiveClass&&c.slides.removeClass(c.slideActiveClass).eq(c.currSlide).addClass(c.slideActiveClass),a&&c.hideNonActive&&c.slides.filter(":not(."+c.slideActiveClass+")").css("visibility","hidden"),0===c.updateView&&setTimeout(function(){c.API.trigger("cycle-update-view",[c,d,e,a])},d.speed/(c.sync?2:1)),0!==c.updateView&&c.API.trigger("cycle-update-view",[c,d,e,a]),a&&c.API.trigger("cycle-update-view-after",[c,d,e]))}},getComponent:function(b){var c=this.opts(),d=c[b];return"string"==typeof d?/^\s*[\>|\+|~]/.test(d)?c.container.find(d):a(d):d.jquery?d:a(d)},stackSlides:function(b,c,d){var e=this.opts();b||(b=e.slides[e.currSlide],c=e.slides[e.nextSlide],d=!e.reverse),a(b).css("zIndex",e.maxZ);var f,g=e.maxZ-2,h=e.slideCount;if(d){for(f=e.currSlide+1;h>f;f++)a(e.slides[f]).css("zIndex",g--);for(f=0;f=0;f--)a(e.slides[f]).css("zIndex",g--);for(f=h-1;f>e.currSlide;f--)a(e.slides[f]).css("zIndex",g--)}a(c).css("zIndex",e.maxZ-1)},getSlideIndex:function(a){return this.opts().slides.index(a)}},a.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))},a.fn.cycle.version=function(){return"Cycle2: "+c},a.fn.cycle.transitions={custom:{},none:{before:function(a,b,c,d){a.API.stackSlides(c,b,d),a.cssBefore={opacity:1,visibility:"visible",display:"block"}}},fade:{before:function(b,c,d,e){var f=b.API.getSlideOpts(b.nextSlide).slideCss||{};b.API.stackSlides(c,d,e),b.cssBefore=a.extend(f,{opacity:0,visibility:"visible",display:"block"}),b.animIn={opacity:1},b.animOut={opacity:0}}},fadeout:{before:function(b,c,d,e){var f=b.API.getSlideOpts(b.nextSlide).slideCss||{};b.API.stackSlides(c,d,e),b.cssBefore=a.extend(f,{opacity:1,visibility:"visible",display:"block"}),b.animOut={opacity:0}}},scrollHorz:{before:function(a,b,c,d){a.API.stackSlides(b,c,d);var e=a.container.css("overflow","hidden").width();a.cssBefore={left:d?e:-e,top:0,opacity:1,visibility:"visible",display:"block"},a.cssAfter={zIndex:a._maxZ-2,left:0},a.animIn={left:0},a.animOut={left:d?-e:e}}}},a.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:void 0,manualSpeed:void 0,manualTrump:!0,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:0},a(document).ready(function(){a(a.fn.cycle.defaults.autoSelector).cycle()})}(jQuery),/*! Cycle2 autoheight plugin; Copyright (c) M.Alsup, 2012; version: 20130913 */ function(a){"use strict";function b(b,d){var e,f,g,h=d.autoHeight;if("container"==h)f=a(d.slides[d.currSlide]).outerHeight(),d.container.height(f);else if(d._autoHeightRatio)d.container.height(d.container.width()/d._autoHeightRatio);else if("calc"===h||"number"==a.type(h)&&h>=0){if(g="calc"===h?c(b,d):h>=d.slides.length?0:h,g==d._sentinelIndex)return;d._sentinelIndex=g,d._sentinel&&d._sentinel.remove(),e=a(d.slides[g].cloneNode(!0)),e.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),e.css({position:"static",visibility:"hidden",display:"block"}).prependTo(d.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active"),e.find("*").css("visibility","hidden"),d._sentinel=e}}function c(b,c){var d=0,e=-1;return c.slides.each(function(b){var c=a(this).height();c>e&&(e=c,d=b)}),d}function d(b,c,d,e){var f=a(e).outerHeight();c.container.animate({height:f},c.autoHeightSpeed,c.autoHeightEasing)}function e(c,f){f._autoHeightOnResize&&(a(window).off("resize orientationchange",f._autoHeightOnResize),f._autoHeightOnResize=null),f.container.off("cycle-slide-added cycle-slide-removed",b),f.container.off("cycle-destroyed",e),f.container.off("cycle-before",d),f._sentinel&&(f._sentinel.remove(),f._sentinel=null)}a.extend(a.fn.cycle.defaults,{autoHeight:0,autoHeightSpeed:250,autoHeightEasing:null}),a(document).on("cycle-initialized",function(c,f){function g(){b(c,f)}var h,i=f.autoHeight,j=a.type(i),k=null;("string"===j||"number"===j)&&(f.container.on("cycle-slide-added cycle-slide-removed",b),f.container.on("cycle-destroyed",e),"container"==i?f.container.on("cycle-before",d):"string"===j&&/\d+\:\d+/.test(i)&&(h=i.match(/(\d+)\:(\d+)/),h=h[1]/h[2],f._autoHeightRatio=h),"number"!==j&&(f._autoHeightOnResize=function(){clearTimeout(k),k=setTimeout(g,50)},a(window).on("resize orientationchange",f._autoHeightOnResize)),setTimeout(g,30))})}(jQuery),/*! caption plugin for Cycle2; version: 20130306 */ function(a){"use strict";a.extend(a.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"
{{title}}
{{desc}}
",captionModule:"caption"}),a(document).on("cycle-update-view",function(b,c,d,e){if("caption"===c.captionModule){a.each(["caption","overlay"],function(){var a=this,b=d[a+"Template"],f=c.API.getComponent(a);f.length&&b?(f.html(c.API.tmpl(b,d,c,e)),f.show()):f.hide()})}}),a(document).on("cycle-destroyed",function(b,c){var d;a.each(["caption","overlay"],function(){var a=this,b=c[a+"Template"];c[a]&&b&&(d=c.API.getComponent("caption"),d.empty())})})}(jQuery),/*! command plugin for Cycle2; version: 20140415 */ function(a){"use strict";var b=a.fn.cycle;a.fn.cycle=function(c){var d,e,f,g=a.makeArray(arguments);return"number"==a.type(c)?this.cycle("goto",c):"string"==a.type(c)?this.each(function(){var h;return d=c,f=a(this).data("cycle.opts"),void 0===f?void b.log('slideshow must be initialized before sending commands; "'+d+'" ignored'):(d="goto"==d?"jump":d,e=f.API[d],a.isFunction(e)?(h=a.makeArray(g),h.shift(),e.apply(f.API,h)):void b.log("unknown command: ",d))}):b.apply(this,arguments)},a.extend(a.fn.cycle,b),a.extend(b.API,{next:function(){var a=this.opts();if(!a.busy||a.manualTrump){var b=a.reverse?-1:1;a.allowWrap===!1&&a.currSlide+b>=a.slideCount||(a.API.advanceSlide(b),a.API.trigger("cycle-next",[a]).log("cycle-next"))}},prev:function(){var a=this.opts();if(!a.busy||a.manualTrump){var b=a.reverse?1:-1;a.allowWrap===!1&&a.currSlide+b<0||(a.API.advanceSlide(b),a.API.trigger("cycle-prev",[a]).log("cycle-prev"))}},destroy:function(){this.stop();var b=this.opts(),c=a.isFunction(a._data)?a._data:a.noop;clearTimeout(b.timeoutId),b.timeoutId=0,b.API.stop(),b.API.trigger("cycle-destroyed",[b]).log("cycle-destroyed"),b.container.removeData(),c(b.container[0],"parsedAttrs",!1),b.retainStylesOnDestroy||(b.container.removeAttr("style"),b.slides.removeAttr("style"),b.slides.removeClass(b.slideActiveClass)),b.slides.each(function(){a(this).removeData(),c(this,"parsedAttrs",!1)})},jump:function(a,b){var c,d=this.opts();if(!d.busy||d.manualTrump){var e=parseInt(a,10);if(isNaN(e)||0>e||e>=d.slides.length)return void d.API.log("goto: invalid slide index: "+e);if(e==d.currSlide)return void d.API.log("goto: skipping, already on slide",e);d.nextSlide=e,clearTimeout(d.timeoutId),d.timeoutId=0,d.API.log("goto: ",e," (zero-index)"),c=d.currSlide .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerEventBubble:void 0,pagerTemplate:""}),a(document).on("cycle-bootstrap",function(a,c,d){d.buildPagerLink=b}),a(document).on("cycle-slide-added",function(a,b,d,e){b.pager&&(b.API.buildPagerLink(b,d,e),b.API.page=c)}),a(document).on("cycle-slide-removed",function(b,c,d){if(c.pager){var e=c.API.getComponent("pager");e.each(function(){var b=a(this);a(b.children()[d]).remove()})}}),a(document).on("cycle-update-view",function(b,c){var d;c.pager&&(d=c.API.getComponent("pager"),d.each(function(){a(this).children().removeClass(c.pagerActiveClass).eq(c.currSlide).addClass(c.pagerActiveClass)}))}),a(document).on("cycle-destroyed",function(a,b){var c=b.API.getComponent("pager");c&&(c.children().off(b.pagerEvent),b.pagerTemplate&&c.empty())})}(jQuery),/*! prevnext plugin for Cycle2; version: 20140408 */ function(a){"use strict";a.extend(a.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),a(document).on("cycle-initialized",function(a,b){if(b.API.getComponent("next").on(b.nextEvent,function(a){a.preventDefault(),b.API.next()}),b.API.getComponent("prev").on(b.prevEvent,function(a){a.preventDefault(),b.API.prev()}),b.swipe){var c=b.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",d=b.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";b.container.on(c,function(){b._tempFx=b.swipeFx,b.API.next()}),b.container.on(d,function(){b._tempFx=b.swipeFx,b.API.prev()})}}),a(document).on("cycle-update-view",function(a,b){if(!b.allowWrap){var c=b.disabledClass,d=b.API.getComponent("next"),e=b.API.getComponent("prev"),f=b._prevBoundry||0,g=void 0!==b._nextBoundry?b._nextBoundry:b.slideCount-1;b.currSlide==g?d.addClass(c).prop("disabled",!0):d.removeClass(c).prop("disabled",!1),b.currSlide===f?e.addClass(c).prop("disabled",!0):e.removeClass(c).prop("disabled",!1)}}),a(document).on("cycle-destroyed",function(a,b){b.API.getComponent("prev").off(b.nextEvent),b.API.getComponent("next").off(b.prevEvent),b.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")})}(jQuery),/*! progressive loader plugin for Cycle2; version: 20130315 */ function(a){"use strict";a.extend(a.fn.cycle.defaults,{progressive:!1}),a(document).on("cycle-pre-initialize",function(b,c){if(c.progressive){var d,e,f=c.API,g=f.next,h=f.prev,i=f.prepareTx,j=a.type(c.progressive);if("array"==j)d=c.progressive;else if(a.isFunction(c.progressive))d=c.progressive(c);else if("string"==j){if(e=a(c.progressive),d=a.trim(e.html()),!d)return;if(/^(\[)/.test(d))try{d=a.parseJSON(d)}catch(k){return void f.log("error parsing progressive slides",k)}else d=d.split(new RegExp(e.data("cycle-split")||"\n")),d[d.length-1]||d.pop()}i&&(f.prepareTx=function(a,b){var e,f;return a||0===d.length?void i.apply(c.API,[a,b]):void(b&&c.currSlide==c.slideCount-1?(f=d[0],d=d.slice(1),c.container.one("cycle-slide-added",function(a,b){setTimeout(function(){b.API.advanceSlide(1)},50)}),c.API.add(f)):b||0!==c.currSlide?i.apply(c.API,[a,b]):(e=d.length-1,f=d[e],d=d.slice(0,e),c.container.one("cycle-slide-added",function(a,b){setTimeout(function(){b.currSlide=1,b.API.advanceSlide(-1)},50)}),c.API.add(f,!0)))}),g&&(f.next=function(){var a=this.opts();if(d.length&&a.currSlide==a.slideCount-1){var b=d[0];d=d.slice(1),a.container.one("cycle-slide-added",function(a,b){g.apply(b.API),b.container.removeClass("cycle-loading")}),a.container.addClass("cycle-loading"),a.API.add(b)}else g.apply(a.API)}),h&&(f.prev=function(){var a=this.opts();if(d.length&&0===a.currSlide){var b=d.length-1,c=d[b];d=d.slice(0,b),a.container.one("cycle-slide-added",function(a,b){b.currSlide=1,b.API.advanceSlide(-1),b.container.removeClass("cycle-loading")}),a.container.addClass("cycle-loading"),a.API.add(c,!0)}else h.apply(a.API)})}})}(jQuery),/*! tmpl plugin for Cycle2; version: 20121227 */ function(a){"use strict";a.extend(a.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),a.extend(a.fn.cycle.API,{tmpl:function(b,c){var d=new RegExp(c.tmplRegex||a.fn.cycle.defaults.tmplRegex,"g"),e=a.makeArray(arguments);return e.shift(),b.replace(d,function(b,c){var d,f,g,h,i=c.split(".");for(d=0;d1)for(h=g,f=0;fe.event.special.swipe.scrollSupressionThreshold&&i.preventDefault()}}var s,o=t.originalEvent.touches?t.originalEvent.touches[0]:t,r={time:(new Date).getTime(),coords:[o.pageX,o.pageY],origin:e(t.target)};i.bind("touchmove",n).one("touchend",function(){i.unbind("touchmove",n),r&&s&&s.time-r.timee.event.special.swipe.horizontalDistanceThreshold&&Math.abs(r.coords[1]-s.coords[1])s.coords[0]?"swipeleft":"swiperight"),r=s=void 0})})}},e.event.special.swipeleft=e.event.special.swipeleft||{setup:function(){e(this).bind("swipe",e.noop)}},e.event.special.swiperight=e.event.special.swiperight||e.event.special.swipeleft})(jQuery);var buttonEvents={};if(null==is2)var is2={};null==is2.util&&(is2.util={});is2.util.removeElements=function(b,c){for(var a=$(b).firstChild,d;null!=a;)d=a.nextSibling,"undefined"!=typeof a.id&&a.id.substring(0,c.length)==c&&a.id!=c&&$(b).removeChild(a),a=d}; is2.util.disableElement=function(b){var c=dwr.util.byId(b);if("button"==$(b).type)c.disabled=!0;else if("icoContent"==$(b).className){var a=c.style.backgroundImage;-1==a.indexOf("_disabled")&&(a=a.substr(0,a.lastIndexOf("."))+"_disabled"+a.substr(a.lastIndexOf("."),a.length),c.style.backgroundImage=a);a=c.onclick;null!=a&&(buttonEvents[b+".onclick"]=a,c.onclick=null)}}; is2.util.enableElement=function(b){var c=dwr.util.byId(b);if("button"==$(b).type)c.disabled=!1;else if("icoContent"==$(b).className){var a=c.style.backgroundImage;-1!=a.indexOf("_disabled")&&(a=a.replace(/_disabled/g,""),c.style.backgroundImage=a);"undefined"!=typeof buttonEvents&&null!=buttonEvents&&(a=buttonEvents[b+".onclick"],null!=a&&(c.onclick=a,buttonEvents[b+".onclick"]=null))}};is2.util.trimString=function(b){if(null==b)return b;/^\s*(.*)\s*$/.exec(b);return null==RegExp.$1?b:RegExp.$1};var ICON_IMMO_OBJECT,ICON_IMMO_OBJECT_SELECTED;function createGoogleIcons(){ICON_IMMO_OBJECT={url:ICON_IMMO_OBJECT_URL,anchor:new google.maps.Point(11,11),size:new google.maps.Size(21,22),scaledSize:new google.maps.Size(21,22)};ICON_IMMO_OBJECT_SELECTED={url:ICON_IMMO_OBJECT_URL_SELECTED,anchor:new google.maps.Point(11,11),size:new google.maps.Size(21,22),scaledSize:new google.maps.Size(21,22)}};function LoginParameters(a){this.presentationId=void 0!=a&&null!=a?a:PRESENTATION_ID;this.mandatorId=MANDATOR_ID;this.userCode=USER_CODE} function ImmoObjectsSearchParameters(a){this.constructor(LoginParameters);this.presentationId=void 0!=a&&null!=a?a:PRESENTATION_ID;this.elementsPerPage=null;this.currentPage=1;this.orderBy=null;this.objectIdentifier=2;this.dateEnd=this.dateStart=this.personCount=this.category=this.regions=this.maximumLocation=this.minimumLocation=this.city=this.radius=this.chosenLocation=this.areaEnd=this.areaStart=this.roomsEnd=this.roomsStart=this.priceEnd=this.priceStart=this.allowedObjectIdentifiers=null} ImmoObjectsSearchParameters.prototype=new LoginParameters;function ImmoObjectParameters(a,b,c){this.constructor(LoginParameters);this.presentationId=void 0!=b&&null!=b?b:PRESENTATION_ID;this.id=a;this.code=c}ImmoObjectParameters.prototype=new LoginParameters; function InquiryParameters(a){this.constructor(LoginParameters);this.presentationId=void 0!=a&&null!=a?a:PRESENTATION_ID;this.earningtype=this.haustiere=this.wbs=this.familyStatus=this.birthplace=this.mobile=this.childrenBirthdays=this.anzahlPersonen=this.adultCount=this.anzahlKinder=this.job=this.birthday=this.distributionChannel=this.isBooking=this.comment=this.childrenCountOfBooking=this.adultCountOfBooking=this.membership=this.dateTo=this.dateFrom=this.infoPerson=this.salutation=this.phone=this.email= this.city=this.postalCode=this.streetNumber=this.street=this.firstName=this.lastName=null}InquiryParameters.prototype=new LoginParameters; function AgentParameters(a){this.constructor(LoginParameters);this.presentationId=void 0!=a&&null!=a?a:PRESENTATION_ID;this.minRooms=this.minArea=this.maxPrice=this.radius=this.location=this.salutation=this.phone=this.email=this.city=this.postalCode=this.streetNumber=this.street=this.firstName=this.lastName=null;this.specialties=[];this.remark=this.earningtype=this.haustiere=this.mobile=this.familyStatus=this.childrenBirthdays=this.adultCount=this.distributionChannel=this.anzahlKinder=this.floor= this.wbs=this.beruf=this.nettoEinkommen=this.etage=this.freiAb=this.maxRooms=this.maxArea=this.minPrice=this.birthday2=this.birthday=this.firstName2=this.lastName2=this.objectIdentifiers=this.regions=this.company=this.realLocation=this.latitude=this.longitude=this.comment=this.categoryIds=this.categories=this.categoryId=this.category=null}AgentParameters.prototype=new LoginParameters;// Validation rules for all fields of a form are specified via a hierarchical OOP structure // ----- Entry error types ----- // Abstract entry error type function AbstractEntryErrorType() { this.message = "Eingabefehler!"; this.validate = function(value) { alert("Call of abstract method not allowed!"); }; this.getMessage = function() { return this.message; }; } function EntryRequired(message) { this.constructor(AbstractEntryErrorType); this.message = message != null ? message : "Eingabe erforderlich!"; this.validate = function(value) { return value != null && is2.util.trimString(value).length > 0; }; } EntryRequired.prototype = new AbstractEntryErrorType(); function MustBeEmpty(message) { this.constructor(AbstractEntryErrorType); this.message = message != null ? message : "Keine Eingabe erlaubt!"; this.validate = function(value) { return value == null || value.length == 0; }; } MustBeEmpty.prototype = new AbstractEntryErrorType(); function MinimumLength(minLen, message) { this.constructor(AbstractEntryErrorType); this.message = message != null ? message : "Eingabe muss mindestens " + minLen + " Zeichen lang sein!"; this.validate = function(value) { return value != null && is2.util.trimString(value).length >= minLen; }; } MinimumLength.prototype = new AbstractEntryErrorType(); function RegExpMustMatch(regularExp, message) { this.constructor(AbstractEntryErrorType); this.regularExp = regularExp; this.message = message != null ? message : "Eingabe inkorrekt!"; this.validate = function(value) { return value != null && value.match(regularExp); }; } RegExpMustMatch.prototype = new AbstractEntryErrorType(); // An OR function for error types (In the validation in class EntryField all error type // validations have to be correct (AND function)). function AtLeastOneMustBeCorrect(errorTypes, message) { this.constructor(AbstractEntryErrorType); this.errorTypes = errorTypes; this.message = message != null ? message : concatenateMessages(); this.validate = function(value) { for (var i = 0; i < errorTypes.length; i++) { var errType = errorTypes[i]; if (errType.validate(value)) { return true; } } return false; }; // Private methods (known only in constructor) function concatenateMessages() { var totalMsg = "Sämtliche der folgenden Eingabefehler sind aufgetreten: "; for (var i = 0; i < errorTypes.length; i++) { var errType = errorTypes[i]; if (i > 0) { totalMsg += ", "; } totalMsg += errType.getMessage(); } return totalMsg; }; } AtLeastOneMustBeCorrect.prototype = new AbstractEntryErrorType(); // An entry field can vulnerable for multiple kinds of entry errors function EntryField(elementId, errorTypes) { this.elementId = elementId; this.errorTypes = errorTypes; this.validate = function() { var value = dwr.util.byId(elementId).value; var success = true; var i = 0; var errType = null; while (i < errorTypes.length && success) { errType = errorTypes[i]; success = errType.validate(value); i++; } if (!success) { dwr.util.setValue(elementId + ".error-message", errType.getMessage()); } var showErrMsgEl = dwr.util.byId(elementId + ".show.error-message"); showErrMsgEl.style.display = success ? "none" : ""; return success; }; this.focus = function() { dwr.util.byId(elementId).focus(); }; this.blur = function() { dwr.util.byId(elementId).blur(); }; this.hideErrorMessage = function() { var showErrMsgEl = dwr.util.byId(elementId + ".show.error-message"); showErrMsgEl.style.display = "none"; }; this.highlightIfRequiredField = function() { var i = 0; while (i < errorTypes.length) { var errType = errorTypes[i]; if (errType instanceof EntryRequired) { var el = dwr.util.byId(elementId); el.className = "required"; return; } i++; } }; } function EntryForm(fields) { this.fields = fields; highlightRequiredFields(); this.validate = function() { var totalSuccess = true; for (var i = 0; i < fields.length; i++) { var field = fields[i]; var fieldSuccess = field.validate(); if (!fieldSuccess && totalSuccess) { totalSuccess = false; // Focus the first field which had an error field.focus(); } } return totalSuccess; }; this.focusFirstField = function() { fields[0].focus(); }; this.hideErrorMessages = function() { for (var i = 0; i < fields.length; i++) { var field = fields[i]; field.hideErrorMessage(); } }; this.blurFocusedField = function() { // There is no way of finding out which field of the form (if any) is currently // focused. So all fields are blurred to make sure the no field is being focused // anymore. for (var i = 0; i < fields.length; i++) { var field = fields[i]; field.blur(); } }; // Private methods (known only in constructor) function highlightRequiredFields() { for (var i = 0; i < fields.length; i++) { var field = fields[i]; field.highlightIfRequiredField(); } } } var currentPage=1,totalPages=1E3,objectId="",objectCode="",embedded=!1,presentationId,defaultLocation="",defaultRadius="",defaultSortOrder="",defaultRegions="",defaultCity="",defaultDateStart="",defaultDateEnd="",defaultSpecialties="",defaultIdentifier="",defaultShowAgentForm="false",skippedLocationAllowed=!1,specialtiesToRestore="",initialRegions=[],objectAlreadyShown=!1,bookmarkUrlTemplate=null,showTwitterButton=!1,showFacebookButton=!1,presentMap=null,onlyLoadGoogleMap=!1,cmpConsentStatusForGoogleMaps= !1,usercentricsConsent={},usercentricsInitialized=!1,closeInitialViewOneTime=!0,AvailableSortOrders={distanceToChosenLocationAsc:"immoObject.distanceToChosenLocation asc",monatlGesamtkostenAsc:"immoObject.monatlGesamtkosten asc",monatlGesamtkostenDesc:"immoObject.monatlGesamtkosten desc",anzahlZimmerAsc:"immoObject.anzahlGanzeZimmer asc, immoObject.anzahlHalbeZimmer asc",anzahlZimmerDesc:"immoObject.anzahlGanzeZimmer desc, immoObject.anzahlHalbeZimmer desc",wohnflaecheAsc:"immoObject."+Configuration.AREA_SORTING_FIELD+ " asc",wohnflaecheDesc:"immoObject."+Configuration.AREA_SORTING_FIELD+" desc"};void 0==window.immoObjectTracker&&(window.immoObjectTracker=null);void 0==window.immoObjectListTracker&&(window.immoObjectListTracker=null);void 0==window.tracker&&(window.tracker=null); var searchRequestHint=!1,filter=new ImmoObjectsSearchParameters(presentationId),filterTest=new ImmoObjectsSearchParameters(presentationId),currentDetailedImmoObject=null,locationChosen=!1,objectsInNotepad=[],detailWindow,imageFlowDirection="none",imageFlowStopped=!0,imageFlowMoveStarted=!1,imageFlowMoveDelay=300; Array.prototype.mkStr=function(a,b,c){for(var d=[],e=0;eb.length&&a.id.substr(0,b.length)==b){var f=a.id.charAt(b.length);if("."==f||"["==f)e=c+a.id.substr(b.length)}e?(d.SUPERCACHE[a.id.substr(b.length+1)]&&dwr.util.setValue(a,d.SUPERCACHE[a.id.substr(b.length+1)]),a.setAttribute("id",e),elemsCache[e]=a):a.removeAttribute("id")}a=a.childNodes;for(e=0;e100*(b.height-c.height)/b.height?(a.style.height="auto",a.style.width=c.width+"px"):(a.style.height=c.height+"px",a.style.width="auto")} function calcThumbDim(a,b,c,d){var e=a,f=b;c||(c=Configuration.MAX_THUMB_WIDTH);d||(d=Configuration.MAX_THUMB_HEIGHT);if(a>c||b>d)f=Math.floor(b/(1*a/c)),e=c,f>d&&(e=Math.floor(a/(1*b/d)),f=d),e>c&&(e=c);return{width:e,height:f}}function calcThumbFilename(a){if(a){var b=a.lastIndexOf(".");0d.getDate()?"0":"")+d.getDate()+"."+(10>d.getMonth()+1?"0":"")+(d.getMonth()+1)+"."+d.getFullYear(); if(0d?(b+=String.fromCharCode(d),c++):191d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}; function cloneObject(a){var b=a instanceof Array?[]:{},c;for(c in a){var d=a[c];if("object"==typeof d)if(d instanceof Array){b[c]=[];for(var e=0;eb.options.maxLabelSize&&(d=d.substring(0,b.options.maxLabelSize)+"...");b.button.set("label",d)}};b.onComboHide=function(){$(this.options.targetId).style.zIndex= $(this.options.targetId).oldZIndex;this._onSelection(this.oldSelection,this.getCheckedNodesAsValueList(!1));this.oldSelection=void 0};b._init=function(){defineCustomYahooTypes();b.tree=new YAHOO.widget.TreeView(b.options.targetTreeId);b.tree.subscribe("checkClick",b._onTreeChecked);b.content=new YAHOO.widget.Panel(this.options.id+"_content",{visible:!1,close:!1});$(b.options.targetTreeId).style.display="";b.content.setBody($(b.options.targetTreeId));if(b.options.footer){var a=document.createElement("div"); a.className="treeComboFooter";b.content.body.appendChild(a);for(var d=0;d=b.getTime()&&a.getTime()<=c.getTime()},isDate:function(a,b,c,d){return dates.withinDate(workingDate,start(b,c,d),end(b,c,d))},sameDate:function(a,b){return a.getDate()=== b.getDate()&&a.getMonth()===b.getMonth()&&a.getFullYear()===b.getFullYear()},formatDate:function(a){return a.getDate()+"."+(a.getMonth()+1)+"."+a.getFullYear()},formatDateYUI:function(a){return a.getMonth()+1+"/"+a.getDate()+"/"+a.getFullYear()}}; function initCalender(a,b){var c=-1!=a.className.indexOf("toolbarItem");c&&($("detailView").calendarButton=a);var d=c?[a]:a.getElementsByClassName("calender-list-button");if(d&&0=k;k++)e.calendar.addWeekdayRenderer(k,d);e.calendar.render();e.calendar.renderEvent.subscribe(function(){e.dialog.fireEvent("changeContent")})}d=e.calendar.getSelectedDates();0 0) { var overlay = overlaysOfMap.pop() overlay.setMap(null) overlay = null } overlays[mapName] = null } } // Load javascript fields dynamically function jsImport(src){ var scriptElem = document.createElement('script'); scriptElem.setAttribute('src', src); scriptElem.setAttribute('type', 'text/javascript'); document.getElementsByTagName('head')[0].appendChild(scriptElem); } function addToMap(immoObject, position) { if (immoObject.labels.latitude != null && immoObject.labels.latitude != 0 && immoObject.labels.longitude != null && immoObject.labels.longitude != 0) { var information = document.getElementById("mapMarkerTemplate[" + position + "]").innerHTML; var objOnMap = new ImmoObjectOnMap( new google.maps.LatLng(immoObject.labels.latitude, immoObject.labels.longitude), information); immoObjectsOnMap.push(objOnMap); } else { immoObjectsOnMap.push(null); } } function initGoogleMap() { // Init map /* if (typeof GUnload == 'undefined') { alert(ERROR_MESSAGE_NO_CONNECTION_TO_GOOGLE_MAPS); return; } */ googleMap = new google.maps.Map(mapView, { mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: true, scaleControl: true, // Kilometers and miles are shown in the map panControl: false, // The pan control allows to move up, down, left and right in the map //zoom: 14, minZoom: 4, // Most of Europe can be completely displayed but not the whole world zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL }, streetViewControl: true } ) if (customizeGoogleMap) { googleMap = customizeGoogleMap(googleMap) } chosenLocationIcon = { anchor: new google.maps.Point(9, 24), url: '../../shared/img/pin_blue.png', size: new google.maps.Size(32, 32) } } function initDetailsGoogleMap() { //console.log("immo_objects_in_google_map.js - Function initDetailsGoogleMap") if ($("#tabContent6")) { detailGoogleMap = new google.maps.Map(object_map_canvas, { mapTypeId: google.maps.MapTypeId.HYBRID, zoom: 17, minZoom: 4, // Most of Europe can be completely displayed but not the whole world zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL }, mapTypeControl: true, scaleControl: true, panControl: false, // The pan control allows to move up, down, left and right in the map streetViewControl: true } ) if (customizeDetailGoogleMap) { detailGoogleMap = customizeDetailGoogleMap(detailGoogleMap) } } } function refreshDetailGoogleMap() { //console.log("immo_objects_in_google_map.js - Function refreshDetailGoogleMap") //console.log("Street view visible: " + detailGoogleMap.getStreetView().getVisible()) // If the google map detail view had been closed with street view activated it shall not be opened again with // street view activated (at the same position as when the immo object detail pop-up was closed) but the map // shall be shown in its default hybrid view if ($("#tabContent6")) { initDetailsGoogleMap(); if (detailGoogleMap.getStreetView().getVisible()) detailGoogleMap.getStreetView().setVisible(false) var lat = $("detailView").results.immoObject.labels.latitude; var lng = $("detailView").results.immoObject.labels.longitude; clearOverlays('detailGoogleMap') var bounds = new google.maps.LatLngBounds() // Implemented checkResize alternative for maps //detailGoogleMap.checkResize(); google.maps.event.trigger(detailGoogleMap, 'resize'); var coord = new google.maps.LatLng(lat, lng); bounds.extend(coord); detailGoogleMap.setCenter(coord); detailGoogleMap.setMapTypeId(google.maps.MapTypeId.HYBRID); var marker = new google.maps.Marker( { map: detailGoogleMap, icon: ICON_IMMO_OBJECT, position: coord, optimized: false // Image may be animated (e.g. for WBGD) }) addToOverlays('detailGoogleMap', marker) detailGoogleMap.setZoom(17) } } function refreshGoogleMap() { // console.log("immo_objects_in_google_map.js - Function refreshGoogleMap") // If street view is currently shown in the main map of the presentation and the search criteria are modified so // that the matching immo objects may change (e. g. another address is entered) or the results are paged and // another page is selected the street view is switched off again if (googleMap.getStreetView().getVisible()) googleMap.getStreetView().setVisible(false) // Initialize bounds var bounds = new google.maps.LatLngBounds(); for (var i=0; i < immoObjectsOnMap.length; i++) { var objOnMap = immoObjectsOnMap[i]; if (objOnMap != null) { var coordinates = objOnMap.coordinates; bounds.extend(coordinates); } } if (locationChosen && chosenLocationMarker != null) { // Location marker (if one is set) is always shown in map when it is redrawn bounds.extend(chosenLocationMarker.getPosition()); } //alert("Bounds: SW: " + bounds.getSouthWest() + " NE: " + bounds.getNorthEast()); googleMap.setCenter(bounds.getCenter()); // Initialize markers if (currentOpenInfoWindow != null) { currentOpenInfoWindow.close() //immoObjectMarkerOfCurrentOpenInfoWindow = null infoWindowOfImmoObjectMarkerIsClosed() } clearOverlays('googleMap') // Set marker to show the chosen location if (locationChosen && chosenLocationMarker != null) { chosenLocationMarker.setMap(googleMap) addToOverlays('googleMap', chosenLocationMarker) } for (var i=0; i < immoObjectsOnMap.length; i++) { function getMarkerAction(marker, information) { // Remove the height style from the div with class="pic". That avoids scroll bars in the info windows // on MSIE, Google Chrome and Safari which otherwise would be shown if the height of the immo object // info shown in the info window would exceed the height of its casket in the list left to the map. // That doesn't work with Firefox. In Firefox the info windows of immo object markers may still have // scroll bars. // information = // information.replace( // /(<(div|DIV)\s+class=(['"]?)pic\3\s+style=(['"])[^\4]*)(height|HEIGHT)\s*:\s*[^;]+;/, // '$1' // ) return function() { // if (typeof console !== 'undefined') // console.info(information) // Only one info window opened at a time if (currentOpenInfoWindow != null) { currentOpenInfoWindow.close() //immoObjectMarkerOfCurrentOpenInfoWindow = null infoWindowOfImmoObjectMarkerIsClosed() } var infoWindow = new google.maps.InfoWindow( { content: //'
' + information + "
" information }) infoWindow.open(googleMap, marker) currentOpenInfoWindow = infoWindow immoObjectMarkerOfCurrentOpenInfoWindow = marker google.maps.event.addListener(infoWindow, "closeclick", infoWindowCloseonMap) } } var objOnMap = immoObjectsOnMap[i]; if (objOnMap != null) { var coordinates = objOnMap.coordinates; var marker = new google.maps.Marker( { map: googleMap, icon: ICON_IMMO_OBJECT, position: coordinates, zIndex: Z_INDEX_OF_IMMO_OBJECT_MARKER, optimized: false // May be animated for some mandators (e. g. WBGD) }) addToOverlays('googleMap', marker) google.maps.event.addListener(marker, "click", getMarkerAction(marker, objOnMap.information //document.getElementById('mapMarkerTemplate[1]').childNodes[1] ) ) google.maps.event.addListener(marker, "mouseover", overMapObject) google.maps.event.addListener(marker, "mouseout", outMapObject) google.maps.event.addListener(marker, "click", clickMapObject) immoObjectsMarkers[i] = marker; } else { immoObjectsMarkers[i] = null; } } // if only one object is in map, set zoom level to 15 if (immoObjectsOnMap.length == 1) { googleMap.setZoom(15); } else { // googleMap.setZoom( // googleMap.getBoundsZoomLevel(bounds)); // 12) googleMap.fitBounds(bounds) } // Debug info // showArea(); // defineArea(); } /** * Performs reverse geocoding */ function lookupAddress(defaultAddress, latitude, longitude, callback) { var geocoder = new google.maps.Geocoder(); geocoder.geocode( { region: 'de', location: new google.maps.LatLng(latitude, longitude), }, function (result, status) { var p = null if (status == google.maps.GeocoderStatus.OK) { result = filterGeoResults(result) /* p = findFirstPlacemarkWith(result.Placemark, ['countryCode', 'country', 'city', 'postalCode'], function (pm) { return isCmpEmpty(pm.cmp.streetAndNumber) || !(/^L\d+$/.test(pm.cmp.streetAndNumber)) }) */ if (result.length >= 1) { p = result[0] } } if (p) callback( //getFullAddress(p), result[0].formatted_address, latitude, longitude ) else callback(defaultAddress, latitude, longitude) }); } function newLocation(searchLocation, latitude, longitude){ lookupAddress(searchLocation, latitude, longitude, function (address, lat, lng) { dwr.util.byId('locationDescription').value = address.replace(/, (Germany|Deutschland)$/, "") // uncommented, because of no new search by onchange of filter // searchImmoObjects(); } ) } /** * Finds if a given point is within a polygon. * * Based on Bob Stein's inpoly() function for C. * http://home.earthlink.net/~bobstein/inpoly/ * * Modified for JavaScript by Scott Andrew LePera. * * Parameters: * poly: array containing x/y coordinate pairs that * describe the vertices of the polygon. Format is * indentical to that of HTML image maps, i.e. [x1,y1,x2,y2,...] * * px: the x-coordinate of the target point. * * py: the y-coordinate of the target point. * * Return value: * true if the point is within the polygon, false if not. */ function isPointInPoly(poly, px, py) { var npoints = poly.length; // number of points in polygon var xnew,ynew,xold,yold,x1,y1,x2,y2,i; var inside=false; if (npoints/2 < 3) { // points don't describe a polygon return false; } xold=poly[npoints-2]; yold=poly[npoints-1]; for (i=0 ; i < npoints ; i=i+2) { xnew=poly[i]; ynew=poly[i+1]; if (xnew > xold) { x1=xold; x2=xnew; y1=yold; y2=ynew; } else { x1=xnew; x2=xold; y1=ynew; y2=yold; } if ((xnew < px) == (px <= xold) && ((py-y1)*(x2-x1) < (y2-y1)*(px-x1))) { inside=!inside; } xold=xnew; yold=ynew; } return inside; } /** * Is the geo-coordinate, given as parameter, in the predefined polys? * * @param coordinate The geo-coordinate to be checked if it is in the area of polygons */ function isMapCoordinateInPolys(coordinate) { if (!Configuration.SEARCH_AREAS || Configuration.SEARCH_AREAS.length == 0) { return true } var polys = window.POLY_CACHE if (!polys) { polys = [] for (var i = 0; i < Configuration.SEARCH_AREAS.length; i++) { var poly = Configuration.SEARCH_AREAS[i] var arr = [] polys.push(arr) for (var j = 0; j < poly.length; j++) { var p = poly[j] arr.push(p[1]); arr.push(p[0]); } } window.POLY_CACHE = polys } for (var i = 0; i < polys.length; i++) { var res = isPointInPoly(polys[i], coordinate.lng(), coordinate.lat()) if (res) { return true; } } return false; } function showArea() { if (!Configuration.SEARCH_AREAS || Configuration.SEARCH_AREAS.length == 0) { alert ("No areas defined") return; } for (var i = 0; i < Configuration.SEARCH_AREAS.length; i++) { var poly = Configuration.SEARCH_AREAS[i] var arr = [] for (var j = 0; j < poly.length; j++) { var p = poly[j] arr.push(new GLatLng(p[0], p[1])); } var polygon = new GPolygon(arr,'#279212', 3, 0.6, '#3DE21B', 0.6); googleMap.addOverlay(polygon); } } function defineArea() { /*if (typeof console !== 'undefined') console.info("Function defineArea")*/ var div = document.createElement("div") div.style.left = "0" div.style.top = "0" div.style.position = "fixed" div.style.width = "400px" div.style.height = "500px" div.style.border = "2px solid black" div.style.zIndex = "100000" div.style.backgroundColor = "white" div.style.overflow = "auto" div.style.padding = "10px" var latlong = document.createElement("div") div.appendChild(latlong) var points = [] var pol = null var mark = null var l = document.createElement("div") var clear = document.createElement("a") clear.innerHTML = "Clear" clear.style.color = "#B51010" clear.style.padding = "10px" clear.style.cursor = "pointer" clear.onclick = function () { l.innerHTML = "" points = [] if (pol) { po.setMap(null) } if (mark) { mark.setMap(null) } } div.appendChild(clear) div.appendChild(l) document.body.appendChild(div) google.maps.event.addListener(googleMap, "mousemove", function(point){ latlong.innerHTML = "Lat: " + point.lat() + "
" + "Long: " + point.lng() }); google.maps.event.addListener(googleMap, "click", function(o, point, o1) { if(!point && o1) { point = o1; } if (point) { points.push(point) var s = document.createElement("div"); s.innerHTML = "[" + point.lat() + ", " + point.lng() + "]," l.appendChild(s) if (pol) { pol.setMap(null) } if (mark) { mark.setMap(null) } pol = new GPolygon(points,'#B30303', 3, 0.6, '#ED827D', 0.6); googleMap.addOverlay(pol); mark = new GMarker(point); googleMap.addOverlay(mark); } }); } /** * Get the address component of a type given as parameter type from an array of address components which is given as * parameter addressComponents. * * @param {Array} addressComponents The address components of one of the results * of a geocoding. * @param {string} type A type of an address component, e. g. 'postal_code' for the ZIP of the address. * @returns {google.maps.GeocoderAddressComponent} The address component having the required type or null if no * address component has the required type. */ function getAddressComponentOfType(addressComponents, type) { for (var i = 0; i < addressComponents.length; i++) { var addressComponent = addressComponents[i] for (var j = 0; j < addressComponent.types.length; j++) { if (addressComponent.types[j] == type) { return addressComponent } } } return null } /** * Check if among the address components given as parameter addressComponents an address component with the type given * as parameter type exists. * * @param {Array} addressComponents The address components of one of the results * of a geocoding. * @param {string} type A type of an address component, e. g. 'postal_code' for the ZIP of the address. * @returns {boolean} true if one (or more) of the address components has the type, otherwise false. */ function hasAddressComponentOfType(addressComponents, type) { return getAddressComponentOfType(addressComponents, type) != null } /** * Get the short name of the country of the address components of one of the results of a geocoding. * E. g. for a result which is in Germany 'de' would be returned. * * @param {Array} addressComponents The address components of one of the results * of a geocoding. * @returns {string} The short name of the country of the address components given as parameter. */ function getCountryCodeOfAddressComponents(addressComponents) { var countryAddrComp = getAddressComponentOfType(addressComponents, 'country') return countryAddrComp.short_name } /** * Check if the adress components given as parameter have the minimum required information for an address to be * used as position. That would be the country (Only localities in Germany are allowed as address) and the * specification of the city (by its locality, e. g. 'Berlin' or its ZIP). * * @param {Array} addressComponents The address components of one of the results * of a geocoding. * @returns {boolean} true if the address components contain the required types, otherwise false. */ function hasAddressComponents(addressComponents) { return addressComponents.length > 0 && ( hasAddressComponentOfType(addressComponents, 'locality') || hasAddressComponentOfType(addressComponents, 'postal_code') ) && hasAddressComponentOfType(addressComponents, 'country') } /** * From the locations resulting from a geocoding the locations which are not in Germany are removed from the result set * of matching locations and, if the areas where the presentation has immo objects are restricted by polygons (defined * by Configuration.SEARCH_AREAS in javascript-config.jsp-configuration-files), locations which are not inside the * areas of these polygons are also removed. * The remaining locations are returned. * * @param {Array} result The locations of a geocoding. * @returns {Array} The locations of that geocoding which match the requirements of the * presentation (e. g. being in Germany). */ function filterGeoResults(result) { //var locations = this.removeDuplicates(result) var resFinal = [] for (var i = 0; i < result.length; i++) { var location = result[i] if ( // If the location is not in Germany or polygons have been declared in which the location has to be // and it is not in those polygons the location is filtered out from the geo results hasAddressComponents(location.address_components) && !( ( //location.address_components.length > 0 && getCountryCodeOfAddressComponents(location.address_components).toLowerCase() != 'de' ) || !this.isMapCoordinateInPolys(location.geometry.location) ) ) { // Do we already have that location? (No duplicates may be in the resulting list) var isDuplicate = false for(var j = 0; j < resFinal.length; j++) { var alreadyLoc = resFinal[j] if ( alreadyLoc.formatted_address === location.formatted_address && alreadyLoc.geometry.location.equals(location.geometry.location) ) { isDuplicate = true break } } if (!isDuplicate) { resFinal.push(location) } } } return resFinal } // ----- Callback functions ----- function BingGeocodeCallback(result) { var errorText; if (result && result.resourceSets && result.resourceSets.length > 0 && result.resourceSets[0].resources && result.resourceSets[0].resources.length == 0) { errorText = "Es konnte kein Ort unter der angegebenen Bezeichnung gefunden werden!" disableObjects(errorText); return; } if (!result) { errorText = "Beim Versuch, die Koordinaten des eingegebenen Ortes zu ermitteln,
" + "kam es zu einem Fehler auf dem Maps Server.
" + "Versuchen Sie es bitte erneut!"; disableObjects(errorText); return; } if (result && result.resourceSets && result.resourceSets.length > 0 && result.resourceSets[0].resources && result.resourceSets[0].resources.length > 0) { var latitude = parseFloat(result.resourceSets[0].resources[0].point.coordinates[0]); var longitude = parseFloat(result.resourceSets[0].resources[0].point.coordinates[1]); var locationCenter = {latitude: latitude, longitude: longitude}; var distanceInKm = parseFloat(dwr.util.getValue("radius")); var distanceInMeters = distanceInKm * 1000; var northPoint, westPoint, southPoint, eastPoint = null; Microsoft.Maps.loadModule('Microsoft.Maps.SpatialMath', function () { northPoint = Microsoft.Maps.SpatialMath.getDestination(locationCenter, 0, distanceInMeters, Microsoft.Maps.SpatialMath.DistanceUnits.Meters); westPoint = Microsoft.Maps.SpatialMath.getDestination(locationCenter, 270, distanceInMeters, Microsoft.Maps.SpatialMath.DistanceUnits.Meters); southPoint = Microsoft.Maps.SpatialMath.getDestination(locationCenter, 180, distanceInMeters, Microsoft.Maps.SpatialMath.DistanceUnits.Meters); eastPoint = Microsoft.Maps.SpatialMath.getDestination(locationCenter, 90, distanceInMeters, Microsoft.Maps.SpatialMath.DistanceUnits.Meters); filter.chosenLocation = { latitude: latitude, longitude:longitude }; filter.radius = distanceInKm; filter.minimumLocation = { latitude: southPoint.latitude, longitude: westPoint.longitude } filter.maximumLocation = { latitude: northPoint.latitude, longitude: eastPoint.longitude } refreshImmoObjectList(); }); } else { refreshImmoObjectList(); } } function searchImmoObjectsByLocation(result, status) { // console.info("Function searchImmoObjectsByLocation") if (status != google.maps.GeocoderStatus.OK) { var errorText; switch (status) { case google.maps.GeocoderStatus.ZERO_RESULTS : errorText = "Kein Ort mit Bezeichnung '" // + result.formatted_address + enteredAddress + "' bekannt!" break; case google.maps.GeocoderStatus.UNKNOWN_ERROR : errorText = "Beim Versuch, die Koordinaten des eingegebenen Ortes zu ermitteln,
" + "kam es zu einem Fehler auf dem Google Maps Server.
" + "Versuchen Sie es bitte erneut!"; break; default : errorText = status; } var buffer ="" + "Fehler bei Suche per Ortsbezeichnung:
" + errorText + "
"; disableObjects(buffer); return; } // Filter out all placemarks which are not in Germany result = filterGeoResults(result) if (result.length == 0) { var buffer = "" + "Fehler bei Suche per Ortsbezeichnung:
" // + "Leider verf�gen wir über keine Angebote in der Nähe Ihrer Suchregion." + "Die eingegebene Suchregion kann nicht verwendet werden.

" + "Mögliche Ursachen:
" + "- Die eingegebene Suchregion befindet sich nicht in Deutschland (Es wurde z. B. "Washington"" + " eingegeben).
" + "- Die Eingabe beschränkt sich nicht auf eine Stadt (Es wurde z. B. lediglich der Name eines" + " Bundeslands eingegeben).
" + ( Configuration.SEARCH_AREAS && Configuration.SEARCH_AREAS.length > 0 ? "- Es werden grundsätzlich nur Immobilien in bestimmten Städten angeboten und die" + " eingegebene Suchregion war außerhalb dieser Städte.
" : "" ) + "
"; disableObjects(buffer, true); return; } // Was more than one location found matching the query? if (result.length > 1) { var buffer = "" + "Die Suche per Ortsbezeichnung brachte mehr als ein Ergebnis!" + "
" + "Eingegebene Ortsbezeichnung: '" //+ result[0].formatted_address + enteredAddress + "', Zahl an passenden Orten: " + result.length + "

Passende Orte:
" + ""; disableObjects(buffer, true); return; } // A unique location was found var coordinates = result[0].geometry.location processLocationPlacemark( //getFullAddress(result[0].address_components), result[0].formatted_address, coordinates.lat(), coordinates.lng() ) } function processLocationPlacemark(fullAddress, latitude, longitude) { // console.info("Function processLocationPlacemark") var locationCenter = new google.maps.LatLng(latitude, longitude) var distanceInKm = parseFloat(dwr.util.getValue("radius")) var distanceInMeters = distanceInKm * 1000 // console.info("locationCenter: " + locationCenter + ", distanceInMeters: " + distanceInMeters) // XMaps isn't used anymore, using Google Maps JS API package google.maps.geometry instead var northPoint = google.maps.geometry.spherical.computeOffset(locationCenter, distanceInMeters, 0) var westPoint = google.maps.geometry.spherical.computeOffset(locationCenter, distanceInMeters, 270) var southPoint = google.maps.geometry.spherical.computeOffset(locationCenter, distanceInMeters, 180) var eastPoint = google.maps.geometry.spherical.computeOffset(locationCenter, distanceInMeters, 90) // console.info("latitude: " + latitude + ", longitude: " + longitude + ", northPoint: " + northPoint // + ", northPoint lat.: " + northPoint.lat()) filter.chosenLocation = { latitude: latitude, longitude:longitude } filter.radius = distanceInKm filter.minimumLocation = { latitude: southPoint.lat(), longitude: westPoint.lng() } filter.maximumLocation = { latitude: northPoint.lat(), longitude: eastPoint.lng() } /* console.info("minimumLocation lat.: " + filter.minimumLocation.latitude + ", minimumLocation lon.: " + filter.minimumLocation.longitude + ", maximumLocation.lat.: " + filter.maximumLocation.latitude + ", maximumLocation lon.: " + filter.maximumLocation.longitude) */ locationChosen = true; searchRequestHint = true; // Define location marker chosenLocationMarker = new google.maps.Marker( { icon:chosenLocationIcon, position: locationCenter }) function getChosenLocationMarkerAction(marker, locationName) { return function() { dwr.util.setValue("locationMarkerTemplate.locationName", locationName); dwr.util.setValue("locationMarkerTemplate.radius", distanceInKm); var html = document.getElementById("locationMarkerTemplate").innerHTML; // Only one info window opened at a time if (currentOpenInfoWindow != null) { currentOpenInfoWindow.close() //immoObjectMarkerOfCurrentOpenInfoWindow = null infoWindowOfImmoObjectMarkerIsClosed() } var infoWindow = new google.maps.InfoWindow( { content: html }) infoWindow.open(googleMap, marker) currentOpenInfoWindow = infoWindow immoObjectMarkerOfCurrentOpenInfoWindow = marker //google.maps.event.addListener(infoWindow, "closeclick", infoWindowCloseonMap) } } var addressName = fullAddress; addressName = addressName.replace(/, (Germany|Deutschland)$/, ""); google.maps.event.addListener(chosenLocationMarker, "click", getChosenLocationMarkerAction(chosenLocationMarker, addressName)); dwr.util.setValue("locationDescription", addressName); refreshImmoObjectList(); } // ----- Functions used by the callback functions ----- /* // Placemark.address sometimes is not unique. Lohbr�gge in Schleswig-Holstein e.g. has // Placemark.address "Lohbr�gge, Germany" which also matches Lohbr�gge in Hamburg. If Lohbr�gge // in Schleswig-Holstein is the placemark parameter of this function the result will be the // unique address "Lohbr�gge, Schleswig-Holstein, Germany". // This operation is only done for german placemarks. For other countries the Placemark.address // is returned. function getFullAddress(addressComponent) { var c = addressComponent.cmp return [ c.streetAndNumber, c.district, [c.postalCode, c.city].mkStr(" "), c.state != c.city ? c.state : null ].mkStr(", ") } */ var present = {} present.Map = Class.create({ options : { validatorFn: null, field: null, formatter: null, locale: null, errorMessage: "Validation error in field '{0}'", additionalPlaceholders: {} }, initialize: function (options) { this.options = $H(this.options).merge(options).toObject() }, loadMap: function (loadedCallbackName) {}, prepareMapAfterLoad: function () {}, initDetailsMap: function () {}, initMap: function () {}, getMarkerTemplate: function () {}, addMarker: function (immoObject, counter) {}, refreshMap: function () {}, isMapAvailable: function (immoObject) { return immoObject.labels.latitude != null && immoObject.labels.latitude != 0 && immoObject.labels.longitude != null && immoObject.labels.longitude != 0 }, geocodeLocation: function (location) {} }) present.GoogleMap = Class.create(present.Map, { defOptions: {}, initialize: function ($super, options) { this.defOptions = $H(this.defOptions).merge(options).toObject() Object.extend(this.defOptions, options) $super(this.defOptions) }, loadMap: function (loadedCallbackName) { var script = document.createElement("script"); script.type = "text/javascript"; script.src = this.getGooglemapScriptUrl(loadedCallbackName); document.body.appendChild(script); }, getGooglemapScriptUrl: function (callback) { // return "http://maps.google.com/maps?file=api&v=2&sensor=false&key=" // + MandatorConstants.GOOGLE_MAPS_KEY + "&async=2&callback=" + callback; return "//maps.googleapis.com/maps/api/js?libraries=geometry,places&v=3.53&key=" + MandatorConstants.GOOGLE_MAPS_KEY + "&client=" + MandatorConstants.GOOGLE_MAPS_CLIENT_ID + "&channel=" + MandatorConstants.GOOGLE_MAPS_CHANNEL + "&language=de&callback=" + callback }, prepareMapAfterLoad: function () { createGoogleIcons() }, initDetailsMap: function () { initDetailsGoogleMap() }, initMap: function () { // If I try to use the visualRefresh look the texts in the info windows (of the markers) aren't styled anymore // Since 2013-11-19 the maps now by default have the look they had before only when the visual refresh had been // explicitly set to true. Since Google Maps JS API ver. 3.14 the visual style is the only style available. // google.maps.visualRefresh = true initGoogleMap() }, getMarkerTemplate: function () { return 'mapMarkerTemplate' }, addMarker: function (immoObject, counter) { addToMap(immoObject, counter); }, refreshMap: function () { refreshGoogleMap() }, /** * Client side geocoding. No access limitation problems. * * @see http://googlemapsapi.blogspot.com/2007/09/coming-soon-ip-based-geocode-limiting.html */ geocodeLocation: function (address) { //console.info("Function geocodeLocation (Client side geocoding)") if (typeof google.maps.Geocoder == 'undefined') { alert(ERROR_MESSAGE_NO_CONNECTION_TO_GOOGLE_MAPS) } else { var geocoder = new google.maps.Geocoder() // Note the entered address so that it can be shown in a message as the latest entered address if more // than one address matches the entered address enteredAddress = address//.trim() //geocoder.setBaseCountryCode("de"); geocoder.geocode( { region: 'de', address: address }, searchImmoObjectsByLocation ) } } }) //present.OSMMap = Class.create(present.Map, { // defOptions: {}, // // initialize: function ($super, options) { // this.defOptions = $H(this.defOptions).merge(options).toObject() // Object.extend(this.defOptions, options) // $super(this.defOptions) // }, // // loadMap: function (loadedCallbackName) { // window[loadedCallbackName]() // }, // // prepareMapAfterLoad: function () { // // }, // // initDetailsMap: function () { //// initDetailsGoogleMap() // }, // // initMap: function () { // this._initIcons() // this.map = new OpenLayers.Map("mapView"); // // var mapnik = new OpenLayers.Layer.OSM(); // // this.map.addLayer(mapnik); // // var markers = new OpenLayers.Layer.Markers( "Markers" ); // this.map.addLayer(markers); // // var size = new OpenLayers.Size(21,25); // var offset = new OpenLayers.Pixel(-(size.w/2), -size.h); // var icon = new OpenLayers.Icon('http://www.openlayers.org/dev/img/marker.png', size, offset); // // // markers.addMarker(new OpenLayers.Marker(this.latLng(52.52, 13.41), this.chosenLocationIcon.clone())); // markers.addMarker(new OpenLayers.Marker(this.latLng(52.52, 13.42), this.immoObjectIcon.clone())); // markers.addMarker(new OpenLayers.Marker(this.latLng(52.52, 13.43), this.immoObjectIcon.clone())); // markers.addMarker(new OpenLayers.Marker(this.latLng(52.52, 13.44), this.immoObjectIcon.clone())); // //// this.map.setCenter(pos, 15) // this.map.zoomToExtent(markers.getDataExtent()); // }, // // _initIcons: function () { // this.chosenLocationIcon = this.icon('../../shared/img/pin_blue.png', 32, 32, 9, 24) // this.immoObjectIcon = this.icon(ICON_IMMO_OBJECT_URL, 21, 22, 11, 11) // }, // //// marker: function (lat, lng, icon, text) { //// var marker = new OpenLayers.Marker(this.latLng(lat, lng), icon.clone()) //// //// marker.events.register('mouseover', marker, function(evt) { //// //// // Get the location of the mouse when entering object //// //// var mx = document.all ? window.event.clientX : ; //// var my = 0; //// //// if (document.all) { //// mx = window.event.clientX; //// my = window.event.clientY; //// } else { //// mx = evt.pageX; //// my = evt.pageY; //// } //// //// var posx = mx + "px"; //// var posy = my + "px"; //// //// //// // set up the mini report of attributes for the tooltip //// //// var atts = document.getElementById("attributes"); //// //// atts.innerHTML = "
"; //// //// atts.innerHTML += "Name : " + sitingName + "
Contact : " + sitingContact + "
siting Date: " + sitingDate + "
Time of day : " + sitingTime + "
Sighting Type : " + sitingType + "
Comm Election Bdy : " + sitingElectoralBdy + "
Local Govt : " + sitingLocalGovt + "
Suburb : " + sitingSuburbs + "
Description : " + sitingDescription; //// //// //// // make adjustment to the div within thge map div //// //// atts.style.position = 'absolute'; //// //// atts.style.top = posy; //// //// atts.style.left = posx; //// //// atts.style.display = 'block'; //// //// Event.stop(evt); //// //// } //// }, // // icon: function (name, width, height, aLeft, aTop) { // var size = new OpenLayers.Size(21,25); // var offset = new OpenLayers.Pixel(aLeft, aTop); // return new OpenLayers.Icon(name, size, offset); // }, // // latLng: function (lat, lng) { // return new OpenLayers.LonLat(lng, lat) // Center of the map // .transform( // new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984 // new OpenLayers.Projection("EPSG:900913") // to Spherical Mercator Projection // ) // }, // // getMarkerTemplate: function () { //// return 'mapMarkerTemplate' // }, // // addMarker: function (immoObject, counter) { //// addToMap(immoObject, counter); // }, // // refreshMap: function () { //// refreshGoogleMap() // }, // // isMapAvailable: function (immoObject) { // return immoObject.labels.latitude != null && // immoObject.labels.latitude != 0 && // immoObject.labels.longitude != null && // immoObject.labels.longitude != 0 // }, // // geocodeLocation: function (location) { // refreshImmoObjectList() // } //}) present.MapQuestMap = Class.create(present.Map, { defOptions: {}, initialize: function ($super, options) { this.defOptions = $H(this.defOptions).merge(options).toObject() Object.extend(this.defOptions, options) $super(this.defOptions) this.objectsToAdd = [] }, loadMap: function (loadedCallbackName) { window[loadedCallbackName]() }, prepareMapAfterLoad: function () { this._initIcons() }, initDetailsMap: function () { // initDetailsGoogleMap() }, initMap: function () { MQA.withModule('smallzoom', 'largezoom', 'mousewheel', function() { this.map = new MQA.TileMap($('mapView'), 3, {lat: 51.09662294502995, lng: 10.01953125}, 'map', {height: "100px"}) this.mainCollection = new MQA.ShapeCollection() this.map.addControl( new MQA.LargeZoom(), new MQA.MapCornerPlacement(MQA.MapCorner.TOP_RIGHT, new MQA.Size(5,5)) ) this.map.enableMouseWheelZoom() this.map.addShapeCollection(this.mainCollection); if (this.refreshNeeded) this.refreshMap() }.bind(this)) }, marker: function (latLng, icon, title, body, listeners) { window.poi = new MQA.Poi(latLng); // poi.setBias({x: 0, y: -1}); // cool stuff poi.setInfoTitleHTML(title); poi.setInfoContentHTML(body); if (listeners) { for (var event in listeners) { MQA.EventManager.addListener(poi, event, listeners[event].bind(poi)) } } if (icon) { this._setMarkerIcon(poi, icon) } poi.latLng = new MQA.LatLng(latLng.lat, latLng.lng) return poi }, _setMarkerIcon: function (poi, icon) { poi.setIcon(icon); if (icon.offset) poi.setIconOffset(new MQA.Point(icon.offset.x, icon.offset.y)); }, _initIcons: function () { this.chosenLocationIcon = new MQA.Icon("../../shared/img/pin_blue.png", 32, 32) this.chosenLocationIcon.offset = {x: -12, y: -26} this.immoObjectIcon = new MQA.Icon(ICON_IMMO_OBJECT_URL, 21, 22) this.immoObjectSelectedIcon = new MQA.Icon(ICON_IMMO_OBJECT_URL_SELECTED, 21, 22) }, getMarkerTemplate: function () { return 'mapMarkerTemplate' }, addMarker: function (immoObject, counter) { this.objectsToAdd.push(immoObject) }, refreshMap: function () { var me = this if (!this.mainCollection) { this.refreshNeeded = true return } this.map.removeAllShapes() this.mainCollection = new MQA.ShapeCollection() this.objectsToAdd.map(function (obj, idx) { var body = document.getElementById("mapMarkerTemplate[" + idx + "]").innerHTML; return me.marker( { lat: obj.labels.latitude, lng: obj.labels.longitude }, me.immoObjectIcon, "" + obj.labels.titel + "", body, { rolloveropen: function () { selectImmoObjectInList(idx) me._setMarkerIcon(this, me.immoObjectSelectedIcon) }, rolloverclose: function () { deselectImmoObjectInList(idx, this.isInfoWindowOpen) me._setMarkerIcon(this, me.immoObjectIcon) }, infowindowopen: function () { this.isInfoWindowOpen = true /*if (typeof console !== 'undefined') console.info(me.mainCollection)*/ me.mainCollection.each(function (other, otherIdx) { deselectImmoObjectInList(other, other.isInfoWindowOpen) }) markImmoObjectInList(idx) me._setMarkerIcon(this, me.immoObjectIcon) }, infowindowclose: function () { /*if (typeof console !== 'undefined') console.info('present.MapQuest.refreshMap:infowindowclose')*/ this.isInfoWindowOpen = false deselectImmoObjectInList(idx, this.isInfoWindowOpen) } }) }).each(function (m) {me.mainCollection.add(m)}) if (locationChosen) { me.marker( {lat: obj.labels.latitude, lng: obj.labels.longitude}, me.chosenLocationIcon, "Immo object title", document.getElementById("mapMarkerTemplate[" + position + "]").innerHTML) } this.objectsToAdd = [] this.map.addShapeCollection(this.mainCollection); this.map.zoomToRect(this.mainCollection.getBoundingRect()) }, geocodeLocation: function (location) { refreshImmoObjectList() } }) present.BingMap = Class.create(present.Map, { defOptions: {}, initialize: function ($super, options) { this.defOptions = $H(this.defOptions).merge(options).toObject() Object.extend(this.defOptions, options) $super(this.defOptions) this.objectsToAdd = []; this.pushpins = []; this.currentIdInResultList = null; }, loadMap: function (loadedCallbackName) { window[loadedCallbackName]() }, prepareMapAfterLoad: function () {}, initDetailsMap: function () {}, initMap: function () { this.map = new Microsoft.Maps.Map(document.getElementById('mapView'), { credentials: MandatorConstants.BING_MAPS_KEY }); }, marker: function (latLng, icon, title, body, listeners) {}, getMarkerTemplate: function () { return 'mapMarkerTemplate' }, addMarker: function (immoObject, counter) { this.objectsToAdd.push(immoObject) }, refreshMap: function () { this.initMap(); this.pushpins = []; // remove all pushpins for (var i = this.map.entities.getLength() - 1; i >= 0; i--) { var pushpin = this.map.entities.get(i); if (pushpin instanceof Microsoft.Maps.Pushpin) { this.map.entities.removeAt(i); } } // add pushpins and info boxes for (i = 0; i < this.objectsToAdd.length; i++) { var obj = this.objectsToAdd[i]; if (obj.labels.latitude && obj.labels.longitude) { var pushpin = new Microsoft.Maps.Pushpin({latitude: obj.labels.latitude, longitude: obj.labels.longitude}, { icon: ICON_IMMO_OBJECT_URL, anchor: new Microsoft.Maps.Point(24, 24) }); // data for info box (title and description) var infoBoxTitle = obj.labels.titel ? obj.labels.titel : ""; var ort = obj.labels.ort; var strasse = obj.labels.strasse; var hausnummer = obj.labels.hausnummer; var anzahlZimmer = obj.labels.anzahlZimmer; var wohnflaeche = obj.labels.wohnflaeche; var nutzflaeche = obj.labels.nutzflache; var monatlGesamtkosten = obj.labels.monatlGesamtkosten; var infoBoxDescription = ""; if (ort) { infoBoxDescription = infoBoxDescription + ort; } if (strasse) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + ", " + strasse : infoBoxDescription; if (hausnummer) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + " " + hausnummer : infoBoxDescription; } } if (anzahlZimmer) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + ", " + anzahlZimmer + " Zimmer" : infoBoxDescription; } if (wohnflaeche) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + ", " + wohnflaeche + " m²" : infoBoxDescription; } else if (nutzflaeche) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + ", " + nutzflaeche + " m²" : infoBoxDescription; } if (monatlGesamtkosten) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + ", " + monatlGesamtkosten + " €" : infoBoxDescription; } // store some metadata with the pushpin pushpin.metadata = { title: infoBoxTitle, description: infoBoxDescription }; pushpin.custId = i; // set the info box var infobox = new Microsoft.Maps.Infobox({latitude: obj.labels.latitude, longitude: obj.labels.longitude}, { visible: false }); infobox.setMap(this.map); // show info box, when pin is clicked Microsoft.Maps.Events.addHandler(pushpin, 'click', function (args) { infobox.setOptions( { location: args.target.getLocation(), title: args.target.metadata.title, description: args.target.metadata.description, visible: true } ); }); idx = 5; // replace pushpin icon by mouseover Microsoft.Maps.Events.addHandler(pushpin, 'mouseover', function (e, idx) { e.target.setOptions({ icon: ICON_IMMO_OBJECT_URL_SELECTED }); $("immoObjectTemplate[" + e.target.custId + "]").style.backgroundImage = 'url(img/back_isobject_selected1.jpg)'; }); // back to standard pushpin icon by mouseout Microsoft.Maps.Events.addHandler(pushpin, 'mouseout', function (e, idx) { e.target.setOptions({ icon: ICON_IMMO_OBJECT_URL }); $("immoObjectTemplate[" + e.target.custId + "]").style.backgroundImage = 'url(img/back_isobject.gif)'; }); this.pushpins.push(pushpin); } this.map.entities.push(this.pushpins); } if (this.objectsToAdd.length > 0) { var mapBounds = this._getLocationRect(); if (mapBounds) { this.map.setView({bounds: mapBounds}); } } this.objectsToAdd = []; }, geocodeLocation: function (address) { var credentials = MandatorConstants.BING_MAPS_KEY; var geocodeRequest = "//dev.virtualearth.net/REST/v1/Locations?query=" + encodeURI(address) + "&output=json&jsonp=BingGeocodeCallback&key=" + credentials; var script = document.createElement("script"); script.setAttribute("type", "text/javascript"); script.setAttribute("src", geocodeRequest); document.body.appendChild(script); }, _getLocationRect: function() { // get the rectangle in which all pins are located to zoom to rectangle of all pins in map var latitudes = []; var longitudes = []; var minLatitute = null; var maxLatitude = null; var minLongitude = null; var maxLongitude = null; var box = null; for (i = 0; i < this.objectsToAdd.length; i++) { var obj = this.objectsToAdd[i]; if (obj.labels.latitude) latitudes.push(obj.labels.latitude); if (obj.labels.longitude) longitudes.push(obj.labels.longitude); } if (latitudes.length > 0 && longitudes.length > 0) { minLatitute = Math.min.apply(null, latitudes); minLongitude = Math.min.apply(null, longitudes); maxLatitude = Math.max.apply(null, latitudes); maxLongitude = Math.max.apply(null, longitudes); } if (minLatitute && minLongitude && maxLatitude && maxLongitude) { box = new Microsoft.Maps.LocationRect.fromEdges(maxLatitude, minLongitude, minLatitute, maxLongitude); } return box; } }) present.NoMap = Class.create(present.Map, { initialize: function ($super, options) { $super(options) }, loadMap: function (loadedCallbackName) { window[loadedCallbackName]() }, prepareMapAfterLoad: function () {}, initDetailsMap: function () {}, initMap: function () {}, getMarkerTemplate: function () {return null}, addMarker: function (immoObject, counter) {}, refreshMap: function () {}, isMapAvailable: function (immoObject) {return false}, geocodeLocation: function (location) { alert("Geocoding is not supported because map is disabled!") } }) var locationChoicesAlwaysAtBottom = false; var sortSelectBox = null /*************************************************** * Immosolve Classes ***************************************************/ // Namespace declarations var ImmoSolve = {}; /** * This class manages field's empty. * * @param elem Element to track * @param emptyValue Text of empty value * @param isEmptyValIsId weather the 'emptyValue' param is the ID of the element * */ ImmoSolve.EmptyValueField = function (elem, emptyValue, isEmptyValIsId) { this.elem = $(elem); this.emptyValue = isEmptyValIsId ? $(emptyValue).innerHTML : emptyValue; var realThis = this; this.onClick = function () { if(this.elem.emptyVal || this.elem.value == this.emptyValue) { this.elem.value = ""; this.elem.style.color = "#666666"; this.elem.emptyVal = true } }; this.onBlur = function () { if (this.elem.value == "") { this.setBlankText(); this.elem.emptyVal = true; } else { if(this.elem.value != this.emptyValue) { this.elem.emptyVal = false; } else { this.elem.emptyVal = true; } } }; this.onChange = function () { if (this.elem.value == this.emptyValue || this.elem.value == "") { this.setBlankText(); this.elem.emptyVal = true; } else { this.elem.emptyVal = false; } }; this.setBlankText = function () { var text = this.emptyValue; var field = this.elem; field.style.color = "#B0B0B0"; field.value = text; }; this.init = function () { this.onBlur(); Event.observe(this.elem, "focus", function () {realThis.onClick()}); Event.observe(this.elem, "click", function () {realThis.onClick()}); Event.observe(this.elem, "blur", function () {realThis.onBlur()}); Event.observe(window, "unload", function () {realThis.elem.value = ""}); //Event.observe(this.elem, "change", function () {realThis.onChange()}); }; this.init(); } /*************************************************** * Immosolve Functions ***************************************************/ function onSortChangeTrack() { if (immoObjectListTracker != null) immoObjectListTracker.trackEvent("SortOrderChanged", dwr.util.getValue("sortOrder").gsub(/immoObject\./, "")); } function themeSpecificInit() { sortSelectBox = new Autocompleter.SelectBox('sortOrder',{onChange:'onSortChangeTrack();'}); } /*----------------------------------------------------------- Toggles element's display value Input: any number of element id's Output: none ---------------------------------------------------------*/ function toggleDisp() { for (var i=0;i"; new Insertion.Before(select, this.element); var inputClasses = Element.classNames(select); inputClasses.each(function(inputClass) { Element.addClassName($(select).id + "_combo", inputClass); }); this.update = "
"; new Insertion.Before(select, this.update); this.baseInitialize($(select).id + "_combo", $(select).id + "_options", options); this.select = select; this.selectOptions = []; $(this.element.id).setAttribute('readOnly','readonly'); this.element.readOnly = true; if (this.options.debug) alert('input ' + this.element.id + ' and div '+ this.update.id + ' created, Autocompleter.Base() initialized'); if(!this.options.debug) Element.hide(select); var optionList = $(this.select).getElementsByTagName('option'); var nodes = $A(optionList); for(i = 0; i < nodes.length; i++) { this.selectOptions.push("
  • " + nodes[i].innerHTML + '
  • '); if (nodes[i].getAttribute("selected")) this.element.value = nodes[i].innerHTML; if (this.options.debug) alert('option ' + nodes[i].innerHTML + ' added to '+ this.update.id); } Event.observe(this.element, "click", this.activate.bindAsEventListener(this)); if ($(select).selectedIndex >= 0) this.element.value = $(select).options[$(select).selectedIndex].innerHTML; var self = this; this.options.afterUpdateElement = function(text, li) { var optionList = $(select).getElementsByTagName('option'); var nodes = $A(optionList); var opt = nodes.find(function(node) { return (node.value == li.id); }); $(select).selectedIndex=opt.index; if(self.options.redirect) document.location.href = opt.value; if(self.options.autoSubmit) $(self.options.autoSubmit).submit; if(self.options.onChange) eval(self.options.onChange); } }, getUpdatedChoices: function() { this.updateChoices(this.setValues()); }, activate: function() { Autocompleter.Base.prototype.activate.call(this); if(Element.getStyle(this.update, 'display') != 'none') { this.hide(); } }, setValues : function(){ return ("
      " + this.selectOptions.join('') + "
    "); }, setOptions: function(options) { this.options = Object.extend({ //MORE OPTIONS TO EXTEND THIS CLASS redirect : false, // redirects to option value debug : false, //show alerts with information autoSubmit : '', //form Id to submit after change onChange : '' }, options || {}); } }); /******************************************** * Scrolling across notepad objects list ********************************************/ var ScrollCounter=0; var SCROLL_OBJECTS_COUNT = 2; /** * @deprecated We use now normal crollbars instaoad of manual scrolling! */ var MAX_OBJECTS_IN_VIEWPORT = Configuration.OBJECTS_PER_PAGE; function moveUp(num){ if (num == undefined) { num = 1; } if (ScrollCounter > 0){ ScrollCounter -= num; new Effect.Move ($('listNotePadHolder'),{ x: 0, y: 104 * num, mode: 'relative', duration: 0.1, transition: Effect.Transitions.sinoidal}); if(ScrollCounter == 0) { $("lisNotePadControlTop").className = "upNotepadListDisabled"; } var numberOfObjects = $("lisNotePadControlBottom").numberOfObjects; if((ScrollCounter * SCROLL_OBJECTS_COUNT) + MAX_OBJECTS_IN_VIEWPORT < numberOfObjects) { $("lisNotePadControlBottom").className = "downNotepadListEnabled"; } else { $("lisNotePadControlBottom").className = "downNotepadListDisabled"; } } } function moveDown(){ var numberOfObjects = $("lisNotePadControlBottom").numberOfObjects; if((ScrollCounter * SCROLL_OBJECTS_COUNT) + MAX_OBJECTS_IN_VIEWPORT < numberOfObjects) { ScrollCounter++; new Effect.Move ($('listNotePadHolder'),{ x: 0, y: -104, mode: 'relative', duration: 0.1, transition: Effect.Transitions.sinoidal}); $("lisNotePadControlTop").className = "upNotepadListEnabled"; if((ScrollCounter * SCROLL_OBJECTS_COUNT) + MAX_OBJECTS_IN_VIEWPORT >= numberOfObjects) { $("lisNotePadControlBottom").className = "downNotepadListDisabled"; } } } function enableNotepadPaggingButtonsTS(numberOfObjects) { if(numberOfObjects > MAX_OBJECTS_IN_VIEWPORT) { if(ScrollCounter == 0) { $("lisNotePadControlTop").className = "upNotepadListDisabled"; } else { $("lisNotePadControlTop").className = "upNotepadListEnabled"; } if((ScrollCounter * SCROLL_OBJECTS_COUNT) + MAX_OBJECTS_IN_VIEWPORT >= numberOfObjects) { $("lisNotePadControlBottom").className = "downNotepadListDisabled"; } else { $("lisNotePadControlBottom").className = "downNotepadListEnabled"; } } else { $("lisNotePadControlTop").className = "upNotepadListDisabled"; $("lisNotePadControlBottom").className = "downNotepadListDisabled"; } $("lisNotePadControlBottom").numberOfObjects = numberOfObjects; $("lisNotePadControlTop").numberOfObjects = numberOfObjects; if(ScrollCounter != 0) { moveUp(ScrollCounter); } } function disableObjects(msg, bottom, center, width, force, preventSearchOrderHide) { setTimeout( function () { if (Configuration.SEARCH_TYPE == "location" || force) { if ($('locationDescription')) { $('locationDescription').focus(); } buffer = msg; $('locationChoices').innerHTML = buffer; showLocationChoices(bottom, center, width, force); } new Effect.Appear('noResultView', {duration: 0.4}); if (!preventSearchOrderHide) hideSearchOrder() }, 400); } function showLocationChoices (bottom, center, width, force) { if (Configuration.SEARCH_TYPE == "location" || force) { var locOffset = null; var locSize = null; if ($("location")) { locOffset = $("location").cumulativeOffset(); locSize = $("location").getDimensions(); } if (center) { if (width) { $('locationChoices').style.width = width + "px"; } locOffset = $("ispage").cumulativeOffset(); var containerSize = $("ispage").getDimensions(); var size = $("locationChoices").getDimensions(); $('locationChoices').style.top = (locOffset.top + (containerSize.height / 2 - (size.height / 2))) + "px"; $('locationChoices').style.left = (locOffset.left + (containerSize.width / 2 - (size.width / 2))) + "px"; } else if (bottom || locationChoicesAlwaysAtBottom) { $('locationChoices').style.top = (locOffset.top + 26) + "px"; $('locationChoices').style.left = locOffset.left + "px"; // location width - paddings - margins $('locationChoices').style.width = locSize.width - 10 * 2 - 2 + "px" } else { $('locationChoices').style.top = (locOffset.top - $('locationChoices').getHeight()) + "px"; $('locationChoices').style.left = locOffset.left + "px"; // location width - paddings - margins $('locationChoices').style.width = locSize.width - 10 * 2 - 2 + "px" } new Effect.Appear('locationChoices', {duration: 0.4}); } } function hideLocationChoices () { if($('locationChoices').style.display != "none") { new Effect.Fade('locationChoices', {duration: 0.4}); } } // If the location is required but not set the list and the map will be blocked by a layer and // a message will be shown in the locationChoices area. // This function is called in function searchImmoObjects and returns a boolean value which // indicates whether the process of searching the immo objects shall be stopped (true -> stop) // or continued (false -> continue) function handleLocationRequired() { if (skippedLocationAllowed) { return false; } if (Configuration.SEARCH_TYPE == "location") { if ($('locationDescription').emptyVal) { disableObjects("Bitte geben Sie einen Suchort an!
    z.B.: \"Straße, PLZ\", \"Straße, Ort\", \"Stadtteil, Ort\""); return true; } else { new Effect.Fade('noResultView', {duration: 0.4}); return false; } } else if (Configuration.SEARCH_TYPE == "region" || Configuration.SEARCH_TYPE == "none") { // TODO: add text: "Regions are not selectd." //disableObjects(""); if (Configuration.STATIC_VIEW) { new Effect.Appear('noResultView', {duration: 0.4}); return true; } else { new Effect.Fade('noResultView', {duration: 0.4}); return false; } } } /***************************************************** * Sliders helper functions (for YUI) *****************************************************/ /** * Creates dual slider (with the help of Yahoo! widgets) * * Options: * name - the name of the slider (it would be placet to the namespace YAHOO.sliders) * * range - sliser range * values - array of fixed values (use this option intead of range) * initialRange - slider initial range * tickSize - tick size of the slider (optional) * * sliderBody - ID of the slider body * sliderMinThumb - ID of the slider min thumb * sliderMaxThumb - ID of the slider max thumb * inputMin - ID of the min input field connected to the slider * inputMax - ID of the max input field connected to the slider * * convertFn - custom convention function (revConvertFn also should be set) (optional) * revConvertFn - custom reverse convention function (convertFn also should be set) (optional) * onChange - slider change handler function */ function createYahooDualSlider(options) { YAHOO.namespace('sliders'); var Dom = YAHOO.util.Dom; var initialRange = options.initialRange.clone(); if(Dom.get(options.inputMin).value != '') { initialRange[0] = Math.abs(parseInt(Dom.get(options.inputMin).value, 10)|0); } if(Dom.get(options.inputMax).value != '') { initialRange[1] = Math.abs(parseInt(Dom.get(options.inputMax).value, 10)|0); } $(options.inputMin).value = initialRange[0]; $(options.inputMax).value = initialRange[1]; $(options.inputMin).oldValue = $(options.inputMin).value; $(options.inputMax).oldValue = $(options.inputMax).value; if(options.values != undefined) { options.range = [1, options.values.length]; } var thumbSize = 10; var r = 120; var ts = options.tickSize == undefined ? 0 : options.tickSize; // r / ((options.range[1] - options.range[0] + 1) * options.tickSize) if(options.convertFn != undefined && options.revConvertFn != undefined) { var convert = options.convertFn; var revConvert = options.revConvertFn; } else { var cf = (options.range[1] - options.range[0]) / (r - thumbSize); var convert = function (val) { var v = Math.round(val * cf + options.range[0]); return options.values == undefined ? v : options.values[v - 1]; }; var revConvert = function(val) { if (options.values != undefined) { val = options.values.indexOf(val) + 1; } return Math.round((val - options.range[0]) / cf); }; } YAHOO.util.Event.onDOMReady(function () { var demo_bg = Dom.get(options.sliderBody), from = Dom.get(options.inputMin), to = Dom.get(options.inputMax); var slider = YAHOO.widget.Slider.getHorizDualSlider( demo_bg, options.sliderMinThumb, options.sliderMaxThumb, r, ts, [revConvert(initialRange[0]), revConvert(initialRange[1]) + thumbSize]); var updateUI = function () { if (slider.activeSlider == slider.minSlider) { if(slider.minVal == (slider.maxVal - thumbSize)) { from.value = to.value; } else { from.value = convert(slider.minVal); } } else { if(slider.minVal == (slider.maxVal - thumbSize)) { to.value = from.value; } else { to.value = convert(slider.maxVal - thumbSize); } } }; var sliderEnd = function(activeSlider) { if(from.oldValue == undefined || from.oldValue != from.value || to.oldValue == undefined || to.oldValue != to.value) { if(options.onChange != undefined) { options.onChange(); } from.oldValue = from.value; to.oldValue = to.value; } }; slider.subscribe('ready', updateUI); slider.subscribe('change', updateUI); slider.subscribe('slideEnd', sliderEnd); var onInputChange = function (e) { if(e != undefined && typeof e != "string") { //Event.stop(e); } var min = Math.abs(parseInt(from.value, 10)|0), max = Math.abs(parseInt(to.value, 10)|0); if(options.values != null) { if(options.values.indexOf(min) == -1) { for (i = 0; i < options.values.length; i++) { if(options.values[i] > min) { min = i == 0 ? options.values[i] : options.values[i - 1]; break; } } } if(options.values.indexOf(max) == -1) { for (i = 0; i < options.values.length; i++) { if(options.values[i] > max) { max = options.values[i]; break; } } } } if (min > max) { var hold = min; min = max; max = hold; } min = Math.max(min, options.values != undefined ? options.values[0] : options.range[0]); max = Math.min(max, options.values != undefined ? options.values[options.values.length - 1] : options.range[1]); slider.setValues(revConvert(min), revConvert(max) + thumbSize, false, false, true); from.value = min; to.value = max; if(options.onChange != undefined && e == undefined && (typeof e != "string" || (typeof e == "string" && e == "stopOnChange"))) { options.onChange(); } } var onKeyPress = function (e) { if (e != undefined && e.keyCode == 13) { Event.stop(e); onInputChange(); } }; YAHOO.util.Event.on(options.inputMin, 'change', onInputChange); YAHOO.util.Event.on(options.inputMax, 'change', onInputChange); YAHOO.util.Event.on(options.inputMax, 'keypress', onKeyPress); YAHOO.util.Event.on(options.inputMin, 'keypress', onKeyPress); $(options.inputMin).fireChanged = onInputChange; $(options.inputMax).fireChanged = onInputChange; slider.subscribe('ready', function () { from.value = initialRange[0]; to.value = initialRange[1]; from.oldValue = from.value; to.oldValue = to.value; }); YAHOO.sliders[options.name] = slider; }); } /** * Creates dual slider (with the help of Yahoo! widgets) * * Options: * name - the name of the slider (it would be placet to the namespace YAHOO.sliders) * * range - sliser range * values - array of fixed values (use this option intead of range) * initialValue - slider initial value * tickSize - tick size of the slider (optional) * * sliderBody - ID of the slider body * sliderThumb - ID of the slider thumb * inputField - ID of the input field connected to the slider (optional) * displayContainer - ID of the contained connected to the slider (optional) * * onChange - slider change handler function */ function createYahooSlider(options) { YAHOO.namespace('sliders'); var Dom = YAHOO.util.Dom; var initialValue = options.initialValue; if(options.inputField != undefined && $(options.inputField).value != '') { initialValue = Math.abs(parseInt($(options.inputField).value, 10)|0); } if(options.displayContainer != undefined && $(options.displayContainer).innerHTML != '') { initialValue = Math.abs(parseInt($(options.displayContainer).innerHTML, 10)|0); } if(options.inputField != undefined) { $(options.inputField).value = initialValue; $(options.inputField).oldValue = initialValue; } else if (options.displayContainer != undefined) { $(options.displayContainer).innerHTML = initialValue; $(options.displayContainer).oldValue = "" + initialValue; } if(options.values != undefined) { options.range = [1, options.values.length - 2]; } var thumbSize = 10; var r = 120; var ts = options.tickSize == undefined ? 0 : options.tickSize; if(options.convertFn != undefined && options.revConvertFn != undefined) { var convert = options.convertFn; var revConvert = options.revConvertFn; } else { var cf = (options.range[1] - options.range[0]) / (r - thumbSize); var convert = function (val) { if (options.values != undefined) { if (val == 0) { return options.values[0]; } else if(val == r) { return options.values[options.values.length - 1]; } } var v = Math.round(val * cf + options.range[0]); return options.values == undefined ? v : options.values[v]; }; var revConvert = function(val) { if (options.values != undefined) { val = options.values.indexOf(val); } return Math.round((val - options.range[0]) / cf); }; } YAHOO.util.Event.onDOMReady(function () { var demo_bg = Dom.get(options.sliderBody); var slider = YAHOO.widget.Slider.getHorizSlider ( demo_bg, options.sliderThumb, 0, r, ts); var updateUI = function () { if(options.inputField != undefined) { Dom.get(options.inputField).value = convert(slider.getValue()); } else if (options.displayContainer != undefined) { $(options.displayContainer).innerHTML = convert(slider.getValue()); } }; slider.subscribe('ready', updateUI); slider.subscribe('change', updateUI); slider.subscribe('slideEnd', function(activeSlider) { var oldVal, val; if(options.inputField != undefined) { val = Dom.get(options.inputField).value; oldVal = Dom.get(options.inputField).oldValue; } else if (options.displayContainer != undefined) { val = $(options.displayContainer).innerHTML; oldVal = $(options.displayContainer).oldValue; } if(oldVal == undefined || oldVal != val) { if(options.onChange != undefined) { options.onChange(); } if(options.inputField != undefined) { Dom.get(options.inputField).oldValue = val; } else if (options.displayContainer != undefined) { $(options.displayContainer).oldValue = val; } } }); var onInputChange = function () { var value; if(options.inputField != undefined) { value = Math.abs(parseInt(Dom.get(options.inputField).value, 10)|0); } else if (options.displayContainer != undefined) { value = Math.abs(parseInt(Dom.get(options.displayContainer).innerHTML, 10)|0); } if(options.values != null && options.values.indexOf(value) == -1) { for (i = 0; i < options.values.length; i++) { if(options.values[i] > value) { value = i == 0 ? options.values[i] : options.values[i - 1]; break; } } } value = Math.max(value, options.values != undefined ? options.values[0] : options.range[0]); value = Math.min(value, options.values != undefined ? options.values[options.values.length - 1] : options.range[1]); slider.setValue(revConvert(value), false, false, true); if(options.inputField != undefined) { Dom.get(options.inputField).value = value; } else if (options.displayContainer != undefined) { Dom.get(options.displayContainer).innerHTML = value; } } if(options.inputField != undefined) { var onKeyPress = function (e) { if (e.keyCode == 13) { options.onInputChange(); if(options.onChange != undefined) { options.onChange() } } }; YAHOO.util.Event.on(options.inputField, 'change', onInputChange); YAHOO.util.Event.on(options.inputField, 'keypress', onKeyPress); } else if (options.displayContainer != undefined) { $(options.displayContainer).fireChanged = onInputChange; } slider.setValue(revConvert(initialValue)); YAHOO.sliders[options.name] = slider; }); } function initButtons () { var buttons = document.getElementsByClassName("immoButton"); for(i = 0; i < buttons.length; i++) { var item = buttons[i]; var icon = item.getAttribute("icon"); var title = item.getAttribute("title"); var label = item.getAttribute("label"); var handler = item.getAttribute("handler"); var onInit = item.getAttribute("onInit"); var buttonId = item.getAttribute("buttonId"); var buttonStyle = item.getAttribute("buttonStyle"); var buttonWidth = item.getAttribute("buttonWidth"); var classSuffix = item.getAttribute("classSuffix"); var additionalClass = item.getAttribute("additionalClass"); if (classSuffix == null || classSuffix == undefined) { classSuffix = ""; } if (additionalClass == null || additionalClass == undefined) { additionalClass = ""; } var table = document.createElement("table"); table.onClickHandler = handler; table.className = "buttonItem" + classSuffix + " " + additionalClass; table.title = title; table.mydisabled = false; table.classSuffix = classSuffix table.additionalClass = additionalClass if (buttonWidth != undefined) { table.width = buttonWidth; } if (buttonStyle != undefined) { table.setAttribute("style", buttonStyle); } if (buttonId != undefined) { table.id = buttonId; } Event.observe(table, 'mouseover', function(event) { var elem = Event.findElement(event, "table"); if (!elem.mydisabled) { elem.className = "buttonItemSelected" + elem.classSuffix + " " + elem.additionalClass; } }); Event.observe(table, 'mouseout', function(event) { var elem = Event.findElement(event, "table"); if (!elem.mydisabled) { elem.className = "buttonItem" + elem.classSuffix + " " + elem.additionalClass; } }); /* Event.observe(table, 'mousedown', function(event) { var elem = Event.findElement(event, "table"); if (!elem.mydisabled) { elem.className = "toolbarItemClicked"; } }); */ Event.observe(table, 'click', function(event) { var elem = Event.findElement(event, "table"); if(!elem.mydisabled) { eval(elem.onClickHandler); } }); table.disable = function () { this.mydisabled = true; table.className = "buttonItemDisabled " + table.additionalClass; } table.enable = function () { this.mydisabled = false; table.className = "buttonItem" + table.classSuffix + " " + table.additionalClass; } table.cellPadding = "0"; table.cellSpacing = "0"; var tbody = document.createElement("tbody"); table.appendChild(tbody); var tr = document.createElement("tr"); tbody.appendChild(tr); var td = document.createElement("td"); td.className = "itemLeft"; td.innerHTML = "
    "; tr.appendChild(td); td = document.createElement("td"); td.className = "itemIcon"; tr.appendChild(td); var img = document.createElement("img"); img.src = icon; td.appendChild(img); if(label != undefined) { td = document.createElement("td"); td.className = "itemLabel"; td.innerHTML = label; td.width = "100%"; tr.appendChild(td); table.labelCell = td; } var td = document.createElement("td"); td.className = "itemRight"; td.innerHTML = "
    "; tr.appendChild(td); item.insert({after: table}) if (onInit != undefined) { window[onInit](table); } } } function initToolbars() { var toolbars = document.getElementsByClassName("toolbar"); for(i = 0; i < toolbars.length; i++) { var items = toolbars[i].getElementsByTagName("div"); var itemsToRemove = new Array(); var closeHandler = toolbars[i].getAttribute("closeHandler"); var hiddenLabels = toolbars[i].getAttribute("hiddenLabels"); var hideLabels = toolbars[i].getAttribute("hideLabels"); var topTable = document.createElement("table"); topTable.style.width = "100%"; topTable.cellPadding = "0"; topTable.cellSpacing = "4"; var topTbody = document.createElement("tbody"); topTable.appendChild(topTbody); var topTr = document.createElement("tr"); topTbody.appendChild(topTr); toolbars[i].appendChild(topTable); for(j = 0; j < items.length; j++) { var item = items[j]; if(item.className != "toolbarIcon") { continue; } var icon = item.getAttribute("icon"); var title = item.getAttribute("title"); var label = item.getAttribute("label"); var handler = item.getAttribute("handler"); var parentStyle = item.getAttribute("parentStyle"); var onInit = item.getAttribute("onInit"); itemsToRemove.push(item); var table = document.createElement("table"); table.onClickHandler = handler; table.className = "toolbarItem"; table.title = title; Event.observe(table, 'mouseover', function(event) { var elem = Event.findElement(event, "table"); elem.className = "toolbarItemSelected"; if((this.hiddenLabels != undefined && this.hiddenLabels == "true") && elem.labelCell != undefined) { elem.labelCell.style.display = ""; } }); Event.observe(table, 'mouseout', function(event) { var elem = Event.findElement(event, "table"); elem.className = "toolbarItem"; if((this.hiddenLabels != undefined && this.hiddenLabels == "true") && elem.labelCell != undefined) { elem.labelCell.style.display = "none"; } }); Event.observe(table, 'mousedown', function(event) { var elem = Event.findElement(event, "table"); elem.className = "toolbarItemClicked"; }); Event.observe(table, 'click', function(event) { var elem = Event.findElement(event, "table"); eval(elem.onClickHandler); }); table.cellPadding = "0"; table.cellSpacing = "0"; table.hiddenLabels = hiddenLabels; var tbody = document.createElement("tbody"); table.appendChild(tbody); var tr = document.createElement("tr"); tbody.appendChild(tr); var td = document.createElement("td"); td.className = "itemLeft"; td.innerHTML = "
    "; tr.appendChild(td); td = document.createElement("td"); td.className = "itemIcon"; tr.appendChild(td); var img = document.createElement("img"); img.src = icon; img.title = title; td.appendChild(img); if(label != undefined && (hideLabels == undefined || hideLabels != "true")) { td = document.createElement("td"); td.className = "itemLabel"; td.innerHTML = label; tr.appendChild(td); table.labelCell = td; if (hiddenLabels != undefined && hiddenLabels == "true") { td.style.display = "none"; } } var td = document.createElement("td"); td.className = "itemRight"; td.innerHTML = "
    "; tr.appendChild(td); var topTd = document.createElement("td"); if(parentStyle != undefined) { topTd.setAttribute("style", parentStyle); } topTr.appendChild(topTd); topTd.appendChild(table); if (onInit != undefined) { window[onInit](table); } } for(j = 0; j < itemsToRemove.length; j++) { itemsToRemove[j].parentNode.removeChild(itemsToRemove[j]); } var t = document.createElement("td"); t.style.width = "100%"; topTr.appendChild(t); if(closeHandler != undefined) { t = document.createElement("td"); t.className = "toolbarCloseTd"; topTr.appendChild(t); var img = document.createElement("div"); img.closeHandler = closeHandler; img.className = "toolbarClose"; t.appendChild(img); Event.observe(img, 'click', function(event) { var elem = Event.findElement(event, "div"); eval(elem.closeHandler); }); Event.observe(img, 'mouseover', function(event) { var elem = Event.findElement(event, "div"); elem.className = "toolbarCloseSelected"; }); Event.observe(img, 'mouseout', function(event) { var elem = Event.findElement(event, "div"); elem.className = "toolbarClose"; }); } } } function hideBigImage() { if($("bigImageContainer")) { $("bigImageContainer").innerHTML = ""; } } function getCssRule (name) { for (i = 0; i < document.styleSheets.length; i++) { var cssRules; if (document.styleSheets[i].rules) { cssRules = document.styleSheets[i].rules; } else { cssRules = document.styleSheets[i].cssRules; } for (j = 0; j < cssRules.length; j++) { if (cssRules[j].selectorText == name) { return cssRules[j]; } } } return null; } function createDetailViewWindow() { if(detailWindow == undefined) { // Instantiate the Dialog detailWindow = new YAHOO.widget.Panel("detailView", { width : "470px", height: showTwitterButton || showFacebookButton ? "520px" : "487px", fixedcenter : true, visible : false, constraintoviewport : true, draggable: true, zIndex: 5000, resizable: false, appendtodocumentbody: true }); $("detailView").style.display = ""; var mapInDetailsAvailable = $("tabContent6") ? true : false; var onCloseOperation = function () { //dwr.util.byId("detailView").style.display = "none"; //hideDetailGoogleMap(); unselectImmoObject(true); hideBigImage(); clearImagesDiv(); } detailWindow.subscribe("hide", onCloseOperation); detailWindow.render(); if (mapInDetailsAvailable) { presentMap.initDetailsMap() var wr = $("object_map_canvas_wrapper"); wr.parentNode.removeChild(wr); $("tabContent6").appendChild(wr); } // perform browser specific positioning if (Prototype.Browser.IE) { var imgLeft = getCssRule(".imagesnavLeft"); var imgRight = getCssRule(".imagesnavRight"); if (mapInDetailsAvailable) { var map = getCssRule(".detailMapCanvas"); var mapWr = getCssRule(".detailMapCanvasWrapper"); } imgLeft.style.top = (parseInt(imgLeft.style.top) - 2) + "px"; imgRight.style.top = (parseInt(imgRight.style.top) - 2) + "px"; imgLeft.style.left = (parseInt(imgLeft.style.left) + 5) + "px"; imgRight.style.left = (parseInt(imgRight.style.left) + 5) + "px"; var version = 999; if (navigator.appVersion.indexOf("MSIE") != -1) { version = parseFloat(navigator.appVersion.split("MSIE")[1]); } if(version < 7) { if (mapInDetailsAvailable) map.style.height= (parseInt(map.style.height) + 2) + "px"; } else { //mapWr.style.top = (parseInt(mapWr.style.top) + 1) + "px"; if (mapInDetailsAvailable) map.style.height= (parseInt(map.style.height) + 1) + "px"; } } else if (Prototype.Browser.Opera) { var imgLeft = getCssRule(".imagesnavLeft"); var imgRight = getCssRule(".imagesnavRight"); if (mapInDetailsAvailable) var mapWr = getCssRule(".detailMapCanvasWrapper"); imgLeft.style.top = (parseInt(imgLeft.style.top) - 2) + "px"; imgRight.style.top = (parseInt(imgRight.style.top) - 2) + "px"; if (mapInDetailsAvailable) { $("tabContent6").className = "tabContent mapTabContentForOpera"; mapWr.style.top = "0px"; mapWr.style.left = "0px"; } } else if (navigator.userAgent.match(/.*Safari.*/)) { var imgLeft = getCssRule(".imagesnavLeft"); var imgRight = getCssRule(".imagesnavRight"); if (mapInDetailsAvailable) { var map = getCssRule(".detailMapCanvas"); var mapWr = getCssRule(".detailMapCanvasWrapper"); } imgLeft.style.top = (parseInt(imgLeft.style.top) - 2) + "px"; imgRight.style.top = (parseInt(imgRight.style.top) - 2) + "px"; //mapWr.style.top = (parseInt(mapWr.style.top) - 10) + "px"; //map.style.height = (parseInt(map.style.height) + 1) + "px"; } else if (Prototype.Browser.Gecko) { var imgLeft = getCssRule(".imagesnavLeft"); var imgRight = getCssRule(".imagesnavRight"); imgLeft.style.top = (parseInt(imgLeft.style.top) - 2) + "px"; imgRight.style.top = (parseInt(imgRight.style.top) - 2) + "px"; } } } function showNotepadeHint(isInNotepad) { if(isInNotepad == undefined || isInNotepad == true) { $("bubbleAddedText").style.display = ""; $("bubbleRemovedText").style.display = "none"; } else { $("bubbleAddedText").style.display = "none"; $("bubbleRemovedText").style.display = ""; } var bubble = document.getElementsByClassName("bubble")[0]; if(bubble.style.display == "none") { new Effect.Appear(bubble, { duration: 0.5 }); setTimeout(hideNotepadeHint, 4000); } } function hideNotepadeHint() { var bubble = document.getElementsByClassName("bubble")[0]; if(bubble.style.display != "none") { new Effect.Fade(bubble, { duration: 0.5 }); } } function showLoading (areaEleement, existingLoadingLayer) { if (existingLoadingLayer != undefined) { existingLoadingLayer.syule.display = ""; return existingLoadingLayer; } var coord = areaEleement.cumulativeOffset(); var dim = areaEleement.getDimensions(); var mainDiv = document.createElement("div"); mainDiv.className = "loadingMainLayer"; makeSamePosAndSize(mainDiv, coord, dim); var loadDiv = document.createElement("div"); loadDiv.className = "loadingLayer"; //makeSamePosAndSize(loadDiv, coord, dim); mainDiv.appendChild(loadDiv); makeSameSize(loadDiv, dim); var iconDiv = document.createElement("div"); iconDiv.className = "loadingIcon"; //makeSamePosAndSize(iconDiv, coord, dim); mainDiv.appendChild(iconDiv); document.body.appendChild(mainDiv); mainDiv.style.display = ""; return mainDiv } function hideLoading (existingLoadingLayer) { existingLoadingLayer.style.display = "none"; } function makeSamePosAndSize(elem, coord, dim) { if (coord != undefined) { elem.style.top = coord.top + "px"; elem.style.left = coord.left + "px"; } makeSameSize(elem, dim); } function makeSameSize(elem, dim) { if (dim != undefined) { elem.style.width = dim.width + "px"; elem.style.height = dim.height + "px"; } } function excapeNewLines(text) { return text.replace(/\r?\n/g, "
    ") }